本文整理汇总了Java中scouter.util.DateUtil.yyyymmdd方法的典型用法代码示例。如果您正苦于以下问题:Java DateUtil.yyyymmdd方法的具体用法?Java DateUtil.yyyymmdd怎么用?Java DateUtil.yyyymmdd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scouter.util.DateUtil
的用法示例。
在下文中一共展示了DateUtil.yyyymmdd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: xlog
import scouter.util.DateUtil; //导入方法依赖的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);
}
}
}
}
示例2: getFile
import scouter.util.DateUtil; //导入方法依赖的package包/类
private File getFile() {
if (outFile == null || dateUnit != DateUtil.getDateUnit()) {
String filename = FILE_PREFIX + "-" + DateUtil.yyyymmdd()+ ".log";
outFile = new File(DIRECTORY, filename);
File parentDir = new File(DIRECTORY);
if (parentDir.exists() == false) {
parentDir.mkdirs();
}
}
return outFile;
}
示例3: setProfileData
import scouter.util.DateUtil; //导入方法依赖的package包/类
public static void setProfileData(XLogPack pack, StepWrapper[] profiles, StyledText text, int pageNum, int rowPerPage, Button prevBtn, Button nextBtn, Button startBtn, Button endBtn, int length, int serverId, int searchLineIndex, boolean isSummary){
String date = DateUtil.yyyymmdd(pack.endTime);
int total = (profiles.length / rowPerPage) + 1;
if(profiles.length % rowPerPage == 0){
total = total - 1;
}
if(pageNum > total){
pageNum = total - 1;
}
ProfileTextFull.buildProfile(date, text, pack, profiles, pageNum, rowPerPage, prevBtn, nextBtn, startBtn, endBtn, length, serverId, searchLineIndex, isSummary);
}
示例4: getColumnText
import scouter.util.DateUtil; //导入方法依赖的package包/类
public String getColumnText(Object element, int columnIndex) {
if (element instanceof BatchData) {
if (columnIndex == ColumnEnum.NO.getIndex()) {
return FormatUtil.print(((BatchData) element).id, "000");
} else if (columnIndex == ColumnEnum.OBJNAME.getIndex()) {
return TextProxy.object.getText(((BatchData) element).objHash);
} else if (columnIndex == ColumnEnum.BATCHJOBID.getIndex()) {
return ((BatchData) element).batchJobId;
} else if (columnIndex == ColumnEnum.ARGS.getIndex()) {
return ((BatchData) element).args;
} else if (columnIndex == ColumnEnum.PID.getIndex()) {
return ((BatchData) element).pID + "";
} else if (columnIndex == ColumnEnum.STARTTIME.getIndex()) {
return DateUtil.yyyymmdd(((BatchData) element).startTime) + " " + DateUtil.hhmmss(((BatchData) element).startTime);
} else if (columnIndex == ColumnEnum.ELAPSEDTIME.getIndex()) {
return FormatUtil.print(((BatchData) element).elapsedTime, "#,##0");
} else if (columnIndex == ColumnEnum.CPUTIME.getIndex()) {
return FormatUtil.print(((BatchData) element).cPUTime, "#,##0");
} else if (columnIndex == ColumnEnum.SQLTOTALTIME.getIndex()) {
return FormatUtil.print((((BatchData) element).sqlTotalTime / 1000000L), "#,##0");
} else if (columnIndex == ColumnEnum.SQLTOTALROWS.getIndex()) {
return FormatUtil.print(((BatchData) element).sqlTotalRows, "#,##0");
} else if (columnIndex == ColumnEnum.SQLTOTALRUNS.getIndex()) {
return FormatUtil.print(((BatchData) element).sqlTotalRuns, "#,##0");
} else if (columnIndex == ColumnEnum.LASTSTAK.getIndex()) {
if(((BatchData) element).lastStack){
return "O";
}else{
return "";
}
}
}
return null;
}
示例5: setInput
import scouter.util.DateUtil; //导入方法依赖的package包/类
public void setInput(String date, String objType) {
this.date = date;
this.objType = objType;
setTitleImage(Images.getObjectIcon(objType, true, serverId));
openTotalGraph();
rangeX1 = DateUtil.yyyymmdd(date);
rangeX2 = rangeX1 + DateUtil.MILLIS_PER_DAY - 1;
updateTextDate();
loadTagGroup();
serviceTable.setInput(new ArrayList<Pack>(), serverId, date);
alertTable.setInput(new ArrayList<Pack>(), serverId, date);
totalCanvas.notifyListeners(SWT.Resize, new Event());
zoomMode = false;
}
示例6: clearOldLog
import scouter.util.DateUtil; //导入方法依赖的package包/类
protected static void clearOldLog() {
if (conf.log_rotation_enalbed == false)
return;
if (conf.log_keep_days <= 0)
return;
long nowUnit = DateUtil.getDateUnit();
File dir = new File(conf.log_dir);
File[] files = dir.listFiles();
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory())
continue;
String name = files[i].getName();
if (name.startsWith("agent-") == false)
continue;
int x = name.lastIndexOf('.');
if (x < 0)
continue;
String date = name.substring("agent-".length(), x);
if (date.length() != 8)
continue;
try {
long d = DateUtil.yyyymmdd(date);
long fileUnit = DateUtil.getDateUnit(d);
if (nowUnit - fileUnit > DateUtil.MILLIS_PER_DAY * conf.log_keep_days) {
files[i].delete();
}
} catch (Exception e) {
}
}
}
示例7: SaveProfileJob
import scouter.util.DateUtil; //导入方法依赖的package包/类
public SaveProfileJob(String name, long date, XLogData xLogData, String txid, int serverId, boolean isSummary) {
super(name);
this.date = date;
this.yyyymmdd = DateUtil.yyyymmdd(date);
this.xLogData = xLogData;
this.txid = txid;
this.serverId = serverId;
this.isSummary = isSummary;
}
示例8: refresh
import scouter.util.DateUtil; //导入方法依赖的package包/类
public void refresh() {
if (isAutoRefresh) {
root.clear();
long now = TimeUtil.getCurrentTime(serverId);
date = DateUtil.yyyymmdd(now);
stime = now - DateUtil.MILLIS_PER_FIVE_MINUTE;
etime = now;
loadQueryJob.schedule();
}
}
示例9: setInput
import scouter.util.DateUtil; //导入方法依赖的package包/类
public void setInput(long stime, long etime) {
if (loadQueryJob.getState() == Job.WAITING || loadQueryJob.getState() == Job.RUNNING) {
MessageDialog.openInformation(null, "STOP", "Previous loading is not yet finished");
return;
}
if (etime - stime < DateUtil.MILLIS_PER_MINUTE) {
stime = etime - DateUtil.MILLIS_PER_MINUTE;
}
root.clear();
this.stime = stime;
this.etime = etime;
this.date = DateUtil.yyyymmdd(stime);
loadQueryJob.schedule();
}
示例10: searchByTxId
import scouter.util.DateUtil; //导入方法依赖的package包/类
public void searchByTxId(XLogData d) {
this.date = DateUtil.yyyymmdd(d.p.endTime);
this.xlogData = d;
loadByTxId();
}
示例11: StackListDialog
import scouter.util.DateUtil; //导入方法依赖的package包/类
public StackListDialog(int serverId, String objName) {
this(serverId, objName, DateUtil.yyyymmdd());
}
示例12: TimeRangeDialog
import scouter.util.DateUtil; //导入方法依赖的package包/类
public TimeRangeDialog(Display display, ITimeRange callback) {
this(display, callback, DateUtil.yyyymmdd(TimeUtil.getCurrentTime()));
}
示例13: refresh
import scouter.util.DateUtil; //导入方法依赖的package包/类
public void refresh() {
String date = DateUtil.yyyymmdd(TimeUtil.getCurrentTime(serverId) - DateUtil.MILLIS_PER_DAY);
if (date.equals(yesterday) == false) {
yesterday = date;
getYesterdayData(date);
}
isActive = false;
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
List<Pack> out = null;
try {
MapPack param = new MapPack();
param.put("counter", this.counter);
param.put("objType", this.objType);
out = tcp.process(RequestCmd.COUNTER_TODAY_ALL, param);
} catch (Throwable t) {
ConsoleProxy.errorSafe(t.toString());
} finally {
TcpProxy.putTcpProxy(tcp);
}
final long[] values = new long[(int)(DateUtil.MILLIS_PER_DAY / DateUtil.MILLIS_PER_HOUR)];
if (out != null && out.size() > 0) {
Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, out, mode, TimeTypeEnum.FIVE_MIN);
Iterator<Long> itr = valueMap.keySet().iterator();
while (itr.hasNext()) {
long time = itr.next();
int index = (int) (DateUtil.getDateMillis(time) / DateUtil.MILLIS_PER_HOUR);
values[index] += valueMap.get(time);
}
isActive = true;
}
ExUtil.exec(this.canvas, new Runnable() {
public void run() {
if (isActive == true) {
setActive();
traceDataProvider.clearTrace();
for (int i = 0; i < values.length; i++) {
traceDataProvider.addSample(new Sample(CastUtil.cdouble(i) + 0.5d, CastUtil.cdouble(values[i])));
}
} else {
setInactive();
}
if (CounterUtil.isPercentValue(objType, counter)) {
xyGraph.primaryYAxis.setRange(0, 100);
} else {
double max = ChartUtil.getMax(traceDataProvider.iterator());
max = Math.max(max, yesterdayMax);
xyGraph.primaryYAxis.setRange(0, max);
}
canvas.redraw();
xyGraph.repaint();
}
});
}
示例14: onPressedOk
import scouter.util.DateUtil; //导入方法依赖的package包/类
public void onPressedOk(long startTime, long endTime) {
this.date = DateUtil.yyyymmdd(startTime);
this.startTime = startTime;
this.endTime = endTime;
goLoadCounteView();
}
示例15: run
import scouter.util.DateUtil; //导入方法依赖的package包/类
protected IStatus run(final IProgressMonitor monitor) {
monitor.beginTask(ServerManager.getInstance().getServer(serverId).getName() + "....", IProgressMonitor.UNKNOWN);
int limit = PManager.getInstance().getInt(PreferenceConstants.P_XLOG_IGNORE_TIME);
int max = getMaxCount();
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
try {
twdata.clear();
MapPack param = new MapPack();
String date = DateUtil.yyyymmdd(stime);
param.put("date", date);
param.put("stime", stime);
param.put("etime", etime);
param.put("objHash", agnetProxy.getObjHashLv(date, serverId, objType));
if (limit > 0) {
param.put("limit", limit);
}
if (max > 0) {
param.put("max", max);
}
ConsoleProxy.infoSafe("Load old XLog data");
ConsoleProxy.infoSafe("stime :" + FormatUtil.print(new Date(stime), "yyyyMMdd HH:mm:ss.SSS"));
ConsoleProxy.infoSafe("etime :" + FormatUtil.print(new Date(etime), "yyyyMMdd HH:mm:ss.SSS"));
ConsoleProxy.infoSafe("objType :" + objType);
ConsoleProxy.infoSafe("limit :" + limit + " max:"+max);
twdata.setMax(max);
final BooleanValue refreshFlag = new BooleanValue(true);
new Thread(new Runnable(){
public void run() {
while(refreshFlag.value){
refresh();
ThreadUtil.sleep(2000);
}
}
}).start();
final DecimalValue count = new DecimalValue();
tcp.process(RequestCmd.TRANX_LOAD_TIME_GROUP, param, new INetReader() {
public void process(DataInputX in) throws IOException {
Pack p = in.readPack();
if (monitor.isCanceled()) {
throw new IOException("User cancelled");
}
XLogPack x = XLogUtil.toXLogPack(p);
twdata.putLast(x.txid, new XLogData(x, serverId));
count.value++;
if (count.value % 10000 == 0) {
// refresh();
monitor.subTask(count.value + " XLog data received.");
}
}
});
refreshFlag.value=false;
} catch (Throwable t) {
ConsoleProxy.errorSafe(t.toString());
} finally {
TcpProxy.putTcpProxy(tcp);
monitor.done();
}
refresh();
return Status.OK_STATUS;
}