本文整理汇总了Java中scouter.util.DateUtil.MILLIS_PER_FIVE_MINUTE属性的典型用法代码示例。如果您正苦于以下问题:Java DateUtil.MILLIS_PER_FIVE_MINUTE属性的具体用法?Java DateUtil.MILLIS_PER_FIVE_MINUTE怎么用?Java DateUtil.MILLIS_PER_FIVE_MINUTE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类scouter.util.DateUtil
的用法示例。
在下文中一共展示了DateUtil.MILLIS_PER_FIVE_MINUTE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clear
public void clear() {
isProcessing = true;
try {
Slot s = meter.getCurrentBucket();
lastSlot.requestCount = s.requestCount;
lastSlot.errorCount = s.errorCount;
lastSlot.elapsed = s.elapsed;
lastSlot.sqlCount = s.sqlCount;
lastSlot.sqlTime = s.sqlTime;
this.maxElapsed = 0;
this.maxSqlCount = 0;
this.maxSqlTime = 0;
this.elapsedExceedCount = 0;
this.requestCount = 0;
this.errorCount = 0;
this.ipAddr = new HashMap<String, Map<String, Integer>>();
this.userAgent = new HashMap<Integer, Map<String, Integer>>();
// 현재 시간의 (0, 5, 10, 15, ... 50, 55분 단위로 변경)
this.startTime = System.currentTimeMillis() / DateUtil.MILLIS_PER_FIVE_MINUTE * DateUtil.MILLIS_PER_FIVE_MINUTE;
} finally {
isProcessing = false;
}
}
示例2: clear
public void clear() {
isProcessing = true;
try {
this.maxActiveService = 0;
this.heapTotal = 0F;
this.maxHeapUsed = 0F;
this.maxRecentUser = 0;
this.maxServiceCount = 0;
this.maxSqlTps = 0F;
this.maxTps = 0F;
// 현재 시간의 (0, 5, 10, 15, ... 50, 55분 단위로 변경)
this.startTime = System.currentTimeMillis() / DateUtil.MILLIS_PER_FIVE_MINUTE * DateUtil.MILLIS_PER_FIVE_MINUTE;
} finally {
isProcessing = false;
}
}
示例3: clear
public void clear() {
isProcessing = true;
try {
Slot s = meter.getCurrentBucket();
lastSlot.netTx = s.netTx;
lastSlot.netRx = s.netRx;
lastSlot.diskRead = s.diskRead;
lastSlot.diskWrite = s.diskWrite;
lastSlot.count = s.count;
this.maxCpu = 0F;
this.memTotal = 0;
this.maxMem = 0F;
this.maxMemUsed = 0;
this.maxNetTx = 0;
this.maxNetRx = 0;
this.maxDiskRead = 0;
this.maxDiskWrite = 0;
// 현재 시간의 (0, 5, 10, 15, ... 50, 55분 단위로 변경)
this.startTime = System.currentTimeMillis() / DateUtil.MILLIS_PER_FIVE_MINUTE * DateUtil.MILLIS_PER_FIVE_MINUTE;
} finally {
isProcessing = false;
}
}
示例4: enduser
@Counter(interval = 500)
public void enduser(CounterBasket pw) {
long time = System.currentTimeMillis();
long now = DateUtil.getMinUnit(time) / 5;
if (now == last_sent)
return;
last_sent = now;
time = (time - 10000) / DateUtil.MILLIS_PER_FIVE_MINUTE * DateUtil.MILLIS_PER_FIVE_MINUTE;
SummaryPack p = EndUserSummary.getInstance().getAndClearNavTable();
if (p != null) {
p.time = time;
DataProxy.send(p);
}
p = EndUserSummary.getInstance().getAndClearAjaxTable();
if (p != null) {
p.time = time;
DataProxy.send(p);
}
p = EndUserSummary.getInstance().getAndClearErrorTable();
if (p != null) {
p.time = time;
DataProxy.send(p);
}
}
示例5: main
public static void main(String[] args) {
final JavaAgentStat jas = new JavaAgentStat(12345);
final long until = System.currentTimeMillis() + (60 * 60 * 1000);
new Thread() {
public void run() {
while (System.currentTimeMillis() < until) {
jas.addMax(5, 1024f, 80.5f, 10, 9, 8, 7, 6);
jas.addAvg(5, 80.5f, 10, 9, 8, 7, 6);
ThreadUtil.sleep(1000);
}
};
}.start();
long time = System.currentTimeMillis();
long last_sent = time / DateUtil.MILLIS_PER_FIVE_MINUTE;
while (System.currentTimeMillis() < until) {
time = System.currentTimeMillis();
long now = time / DateUtil.MILLIS_PER_FIVE_MINUTE;
if (now != last_sent) {
last_sent = now;
time = (time - 10000) / DateUtil.MILLIS_PER_FIVE_MINUTE * DateUtil.MILLIS_PER_FIVE_MINUTE;
System.err.println(new Date(time) + ":" + jas.getJavaAgentAndClear());
}
ThreadUtil.sleep(1000);
}
}
示例6: main
public static void main(String[] args) {
final HostAgentStat has = new HostAgentStat(12345);
final long until = System.currentTimeMillis() + (60 * 60 * 1000);
new Thread() {
public void run() {
while (System.currentTimeMillis() < until) {
has.addMax(90.7f, 16 * 1024 * 1024, 52.5f, 7 * 1024 * 1024, 10, 20, 30, 40);
has.addAvg(90.7f, 52.5f, 7 * 1024 * 1024);
ThreadUtil.sleep(1000);
}
};
}.start();
long time = System.currentTimeMillis();
long last_sent = time / DateUtil.MILLIS_PER_FIVE_MINUTE;
while (System.currentTimeMillis() < until) {
time = System.currentTimeMillis();
long now = time / DateUtil.MILLIS_PER_FIVE_MINUTE;
if (now != last_sent) {
last_sent = now;
time = (time - 10000) / DateUtil.MILLIS_PER_FIVE_MINUTE * DateUtil.MILLIS_PER_FIVE_MINUTE;
System.err.println(new Date(time) + ":" + has.getHostAgentAndClear());
}
ThreadUtil.sleep(1000);
}
}
示例7: setInput
public void setInput(String sDate, String eDate, String objType, String counter, int serverId) throws Exception {
this.sDate = sDate;
this.eDate = eDate;
this.objType = objType;
this.counter = counter;
this.mode = CounterUtil.getTotalMode(objType, counter);
this.serverId = serverId;
setViewTab(objType, counter, serverId, false);
Server server = ServerManager.getInstance().getServer(serverId);
String counterUnit = "";
String counterDisplay = "";
if(server != null){
counterUnit = server.getCounterEngine().getCounterUnit(objType, counter);
counterDisplay = server.getCounterEngine().getCounterDisplayName(objType, counter);
desc = "(Period) [" + sDate.substring(0, 4) + "-" + sDate.substring(4, 6) + "-" + sDate.substring(6, 8) +
" ~ " + eDate.substring(0, 4) + "-" + eDate.substring(4, 6) + "-" + eDate.substring(6, 8) +
"] Total " + counterDisplay;
}
serverText.setText("ⓢ"+((server == null)? "?":server.getName())+" |"+(!"".equals(counterUnit)?" ("+counterUnit+")":""));
stime = DateUtil.getTime(sDate, "yyyyMMdd");
etime = DateUtil.getTime(eDate, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY;
this.xyGraph.primaryXAxis.setRange(stime, etime);
sDateText.setText(DateUtil.format(stime, "yyyy-MM-dd"));
eDateText.setText(DateUtil.format(etime-1, "yyyy-MM-dd"));
buffer = (int) ((etime - stime) / DateUtil.MILLIS_PER_FIVE_MINUTE);
traceDataProvider.setBufferSize(buffer);
MenuUtil.createCounterContextMenu(ID, canvas, serverId, objType, counter);
ExUtil.asyncRun(new Runnable() {
public void run() {
load();
}
});
}
示例8: addPastObjTypeSpecialMenu
public static void addPastObjTypeSpecialMenu(IWorkbenchWindow win, IMenuManager mgr, int serverId, String objType, CounterEngine counterEngine, String date) {
long st = DateUtil.yyyymmdd(date);
long et = st + DateUtil.MILLIS_PER_FIVE_MINUTE;
if (counterEngine.isChildOf(objType, CounterConstants.FAMILY_JAVAEE)) {
mgr.add(new Separator());
mgr.add(new OpenXLogLoadTimeAction(win, objType, Images.transrealtime, serverId, st, et));
mgr.add(new OpenDailyServiceCountAction(win, objType, CounterConstants.WAS_SERVICE_COUNT, Images.TYPE_SERVICE_COUNT, serverId, date));
}
}
示例9: refresh
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();
}
}
示例10: ServiceStat
public ServiceStat(int objHash, int serviceHash) {
this.objHash = objHash;
this.serviceHash = serviceHash;
this.startTime = System.currentTimeMillis() / DateUtil.MILLIS_PER_FIVE_MINUTE * DateUtil.MILLIS_PER_FIVE_MINUTE;
}
示例11: JavaAgentStat
public JavaAgentStat(int objHash) {
this.objHash = objHash;
this.startTime = System.currentTimeMillis() / DateUtil.MILLIS_PER_FIVE_MINUTE * DateUtil.MILLIS_PER_FIVE_MINUTE;
}
示例12: HostAgentStat
public HostAgentStat(int objHash) {
this.objHash = objHash;
this.startTime = System.currentTimeMillis() / DateUtil.MILLIS_PER_FIVE_MINUTE * DateUtil.MILLIS_PER_FIVE_MINUTE;
}
示例13: showWithEndTime
public void showWithEndTime() {
long etime = (TimeUtil.getCurrentTime() / 60000) * 60000;
long stime = etime - DateUtil.MILLIS_PER_FIVE_MINUTE;
showWithEndTime(stime, etime);
}
示例14: setInput
public void setInput(String sDate, String eDate, String objType, String counter, int serverId) throws Exception {
this.sDate = sDate;
this.eDate = eDate;
this.objType = objType;
this.counter = counter;
this.serverId = serverId;
setViewTab(objType, counter, serverId, false);
stime = DateUtil.getTime(sDate, "yyyyMMdd");
etime = DateUtil.getTime(eDate, "yyyyMMdd") + DateUtil.MILLIS_PER_DAY;
this.xyGraph.primaryXAxis.setRange(stime, etime);
Server server = ServerManager.getInstance().getServer(serverId);
String counterUnit = "";
String counterDisplay = "";
if(server != null){
counterUnit = server.getCounterEngine().getCounterUnit(objType, counter);
counterDisplay = server.getCounterEngine().getCounterDisplayName(objType, counter);
desc = "(Daily All) [" + sDate.substring(0, 4) + "-" + sDate.substring(4, 6) + "-" + sDate.substring(6, 8) +
" ~ " + eDate.substring(0, 4) + "-" + eDate.substring(4, 6) + "-" + eDate.substring(6, 8) +
"]" + counterDisplay;
}
serverText.setText("ⓢ"+((server == null)? "?":server.getName())+" |"+(!"".equals(counterUnit)?" ("+counterUnit+")":""));
sDateText.setText(DateUtil.format(stime, "yyyy-MM-dd"));
eDateText.setText(DateUtil.format(etime-1, "yyyy-MM-dd"));
buffer = (int) ((etime - stime) / DateUtil.MILLIS_PER_FIVE_MINUTE);
Iterator<Trace> itr = traces.values().iterator();
while (itr.hasNext()) {
Trace tr = itr.next();
this.xyGraph.removeTrace(tr);
}
traces.clear();
MenuUtil.createCounterContextMenu(ID, canvas, serverId, objType, counter);
ExUtil.asyncRun(new Runnable() {
public void run() {
load(CounterPastLongDateAllView.this.sDate, CounterPastLongDateAllView.this.eDate, CounterPastLongDateAllView.this.counter);
}
});
}
示例15: run
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
TimedSeries<String, Double> sereis = new TimedSeries<String, Double>();
Range xRange = xyGraph.primaryXAxis.getRange();
long lower = (long) xRange.getLower();
long upper = (long) xRange.getUpper();
List<Trace> traceList = xyGraph.getPlotArea().getTraceList();
List<String> titleValues = new ArrayList<String>();
titleValues.add("Time");
for (Trace t : traceList) {
titleValues.add(t.getName());
CircularBufferDataProvider provider = (CircularBufferDataProvider) t.getDataProvider();
for (int inx = 0; inx < provider.getSize(); inx++) {
Sample sample = (Sample) provider.getSample(inx);
double x = sample.getXValue();
if(x < lower || x > upper) {
continue;
}
double y = sample.getYValue();
sereis.add(t.getName(), (long)x, y);
}
}
List<String[]> values = new ArrayList<String[]>();
values.add(titleValues.toArray(new String[titleValues.size()]));
while (lower < upper) {
List<String> value = new ArrayList<String>();
value.add(DateUtil.format(lower, "yyyy-MM-dd HH:mm"));
for (int i = 1; i < titleValues.size(); i++) {
String objName = titleValues.get(i);
Double d = sereis.getInTime(objName, lower, DateUtil.MILLIS_PER_FIVE_MINUTE - 1);
if (d != null) {
value.add(FormatUtil.print(d.doubleValue(), "#,###.##"));
} else {
value.add("");
}
}
values.add(value.toArray(new String[value.size()]));
lower += DateUtil.MILLIS_PER_FIVE_MINUTE;
}
CSVWriter cw = new CSVWriter(new FileWriter(filePath));
cw.writeAll(values);
cw.flush();
cw.close();
} catch (Exception e) {
e.printStackTrace();
return Status.CANCEL_STATUS;
}
return Status.OK_STATUS;
}