• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TextRD类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中scouter.server.db.TextRD的典型用法代码示例。如果您正苦于以下问题:Java TextRD类的具体用法?Java TextRD怎么用?Java TextRD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

TextRD类属于scouter.server.db包,在下文中一共展示了TextRD类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: xlog

点赞 3

import scouter.server.db.TextRD; //导入依赖的package包/类
@ServerPlugin(PluginConstants.PLUGIN_SERVER_XLOG)
public void xlog(XLogPack pack) {
	if (conf.getBoolean("ext_plugin_teamup_xlog_enabled", true)) {
		println("[ext_plugin_teamup_xlog_enabled true]");
		if (pack.error != 0) {
			String date = DateUtil.yyyymmdd(pack.endTime);
			String service = TextRD.getString(date, TextTypes.SERVICE, pack.service);
			String patterns = conf.getValue("ext_plugin_teamup_error_escape_method_patterns").length()>0?conf.getValue("ext_plugin_teamup_error_escape_method_patterns"):"*";
			if (!PatternsUtil.isValid(patterns, service)) {
				AlertPack ap = new AlertPack();
				ap.level = AlertLevel.ERROR;
				ap.objHash = pack.objHash;
				ap.title = "Ultron Error";
				ap.message = service + " - " + TextRD.getString(date, TextTypes.ERROR, pack.error);
				ap.time = System.currentTimeMillis();
				ap.objType = "scouter";
				alert(ap);
			}else{
				println("escape service : " + service);
			}
		}
	}
}
 

开发者ID:kingbbode,
项目名称:scouter-plugin-server-alert-teamup,
代码行数:24,
代码来源:TeamUpPlugin.java

示例2: xlog

点赞 3

import scouter.server.db.TextRD; //导入依赖的package包/类
/**
   * XLogPack 발생 시 처리
   * @param pack
   */
  @ServerPlugin(PluginConstants.PLUGIN_SERVER_XLOG)
  public void xlog(XLogPack pack) {
  	try {
   	if (serviceStatMap.get(pack.objHash) == null) {
   		serviceStatMap.put(pack.objHash, new ConcurrentHashMap<Integer, ServiceStat>());
   	}
   	
   	if (serviceStatMap.get(pack.objHash).get(pack.service) == null) {
   		serviceStatMap.get(pack.objHash).put(pack.service, new ServiceStat(pack.objHash, pack.service));
   	}

   	String serviceName = TextRD.getString(DateUtil.yyyymmdd(pack.endTime), TextTypes.SERVICE, pack.service);
  		InetAddress inetAddr = InetAddress.getByAddress(pack.ipaddr);
  		serviceStatMap.get(pack.objHash).get(pack.service).add(serviceName, pack.elapsed, pack.error != 0, inetAddr == null ? null : inetAddr.getHostAddress(), pack.userAgent, pack.sqlCount, pack.sqlTime);
} catch (Exception e) {
	Logger.printStackTrace(e);
}
  }
 

开发者ID:OpenSourceConsulting,
项目名称:scouter-plugin-server-reporting,
代码行数:23,
代码来源:ReportingPlugin.java

示例3: xlog

点赞 3

import scouter.server.db.TextRD; //导入依赖的package包/类
@ServerPlugin(PluginConstants.PLUGIN_SERVER_XLOG)
  public void xlog(XLogPack pack) {
  	try {
  		int elapsedThreshold = conf.getInt("ext_plugin_elapsed_time_threshold", 0);
  		
  		if (elapsedThreshold != 0 && pack.elapsed > elapsedThreshold) {
  			String serviceName = TextRD.getString(DateUtil.yyyymmdd(pack.endTime), TextTypes.SERVICE, pack.service);
  			
  			AlertPack ap = new AlertPack();
  			
        ap.level = AlertLevel.WARN;
        ap.objHash = pack.objHash;
        ap.title = "Elapsed time exceed a threshold.";
        ap.message = "[" + AgentManager.getAgentName(pack.objHash) + "] " 
        				+ pack.service + "(" + serviceName + ") "
        				+ "elapsed time(" + pack.elapsed + " ms) exceed a threshold.";
        ap.time = System.currentTimeMillis();
        ap.objType = AgentManager.getAgent(pack.objHash).objType;
		
        alert(ap);
  		}
  		
} catch (Exception e) {
	Logger.printStackTrace(e);
}
  }
 

开发者ID:scouter-project,
项目名称:scouter-plugin-server-alert-email,
代码行数:27,
代码来源:EmailPlugin.java

示例4: summary

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
/**
 * SummaryPack 발생 시 처리
 * @param pack
 */
@ServerPlugin(PluginConstants.PLUGIN_SERVER_SUMMARY)
public void summary(SummaryPack pack) {
	if (pack.stype == SummaryEnum.SQL) {
		ListValue idList = pack.table.getList("id");
		ListValue countList = pack.table.getList("count");
		ListValue errorList = pack.table.getList("error");
		ListValue elapsedList = pack.table.getList("elapsed");
		
		SqlInfo sqlInfo = null;
		Sql sql = null;
		int sqlHash = 0;
		String sqlStr = null;
		
		Iterator<Value> iter = idList.iterator();
		Value id, count, error, elapsed = null;
		int idx = 0;
		while (iter.hasNext()) {
			id = iter.next();
			count = countList.get(idx);
			error = errorList.get(idx);
			elapsed = elapsedList.get(idx++);

SqlSession session = sqlSessionFactory.openSession(true);
			try {
				sqlHash = ((Number) id.toJavaObject()).intValue();
				sqlStr = TextRD.getString(DateUtil.yyyymmdd(pack.time), TextTypes.SQL, sqlHash);
				
				if (sqlStr != null && sqlStr.length() > 32000) {
					Logger.println("SQL String is too long to insert SQL_INFO_TBL.");
					sqlStr = sqlStr.substring(0, 32000) + "...";
				}
						
				sqlInfo = session.selectOne("Scouter.selectSqlInfo", ((Number) id.toJavaObject()).intValue());
				if (sqlInfo == null) {
					sqlInfo = new SqlInfo();
					sqlInfo.setSql_hash(sqlHash);
					sqlInfo.setSql_str(sqlStr);
					session.insert("Scouter.insertSqlInfo", sqlInfo);
				} else {
					if (sqlInfo.getSql_str() == null) {
    					sqlInfo.setSql_str(sqlStr);
    					session.update("Scouter.updateSqlInfo", sqlInfo);
					} else if (!sqlInfo.getSql_str().equals(sqlStr)) {
    					sqlInfo.setSql_str(sqlStr);
    					session.update("Scouter.updateSqlInfo", sqlInfo);
					}
				}
				
	sql = new Sql();
	sql.setDate(pack.time);
	sql.setObject_hash(pack.objHash);
	sql.setSql_hash(((Number) id.toJavaObject()).intValue());
	sql.setLog_dt(new java.sql.Date(pack.time));
	sql.setLog_tm(new Time(pack.time));
	sql.setExecute_count(((Number) count.toJavaObject()).intValue());
	sql.setError_count(((Number) error.toJavaObject()).intValue());
	sql.setElapsed(((Number) elapsed.toJavaObject()).intValue());
	
	session.insert("Scouter.insertSql", sql);
} catch (Exception e) {
	Logger.printStackTrace(e);
} finally {
	if (session != null) {
		session.close();
	}
}
		}
	}
}
 

开发者ID:OpenSourceConsulting,
项目名称:scouter-plugin-server-reporting,
代码行数:74,
代码来源:ReportingPlugin.java

示例5: service

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
public String service(XLogPack p) {
	return TextRD.getString(DateUtil.yyyymmdd(p.endTime), TextTypes.SERVICE, p.service);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:4,
代码来源:IXLog.java

示例6: error

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
public String error(XLogPack p) {
	return TextRD.getString(DateUtil.yyyymmdd(p.endTime), TextTypes.ERROR, p.error);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:4,
代码来源:IXLog.java

示例7: getErrorString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getErrorString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.ERROR, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例8: getApicallString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getApicallString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.APICALL, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例9: getMethodString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getMethodString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.METHOD, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例10: getServiceString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getServiceString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.SERVICE, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例11: getSqlString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getSqlString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.SQL, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例12: getObjectString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getObjectString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.OBJECT, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例13: getRefererString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getRefererString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.REFERER, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例14: getUserAgentString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getUserAgentString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.USER_AGENT, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例15: getUserGroupString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getUserGroupString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.GROUP, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例16: getCityString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getCityString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.CITY, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例17: getLoginString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getLoginString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.LOGIN, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例18: getDescString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getDescString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.DESC, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例19: getWebString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getWebString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.WEB, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java

示例20: getHashMsgString

点赞 2

import scouter.server.db.TextRD; //导入依赖的package包/类
@Internal
public String getHashMsgString(String yyyymmdd, int hash) {
	return TextRD.getString(yyyymmdd, TextTypes.HASH_MSG, hash);
}
 

开发者ID:scouter-project,
项目名称:scouter,
代码行数:5,
代码来源:PluginHelper.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)