本文整理了Java中com.codahale.metrics.Snapshot.<init>()
方法的一些代码示例,展示了Snapshot.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Snapshot.<init>()
方法的具体详情如下:
包路径:com.codahale.metrics.Snapshot
类名称:Snapshot
方法名:<init>
[英]Create a new Snapshot with the given values.
[中]使用给定的值创建新快照。
代码示例来源:origin: com.codahale.metrics/metrics-core
@Override
public Snapshot getSnapshot() {
final long[] values = new long[size()];
for (int i = 0; i < values.length; i++) {
synchronized (this) {
values[i] = measurements[i];
}
}
return new Snapshot(values);
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics
@Override
public Snapshot getSnapshot() {
final long[] values = new long[size()];
for (int i = 0; i < values.length; i++) {
synchronized (this) {
values[i] = measurements[i];
}
}
return new Snapshot(values);
}
}
代码示例来源:origin: com.codahale.metrics/metrics-core
@Override
public Snapshot getSnapshot() {
final int s = size();
final List<Long> copy = new ArrayList<Long>(s);
for (int i = 0; i < s; i++) {
copy.add(values.get(i));
}
return new Snapshot(copy);
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics
@Override
public Snapshot getSnapshot() {
final int s = size();
final List<Long> copy = new ArrayList<Long>(s);
for (int i = 0; i < s; i++) {
copy.add(values.get(i));
}
return new Snapshot(copy);
}
}
代码示例来源:origin: com.codahale.metrics/metrics-core
@Override
public Snapshot getSnapshot() {
trim();
return new Snapshot(measurements.values());
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics
@Override
public Snapshot getSnapshot() {
trim();
return new Snapshot(measurements.values());
}
代码示例来源:origin: com.codahale.metrics/metrics-core
@Override
public Snapshot getSnapshot() {
lockForRegularUsage();
try {
return new Snapshot(values.values());
} finally {
unlockForRegularUsage();
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics
@Override
public Snapshot getSnapshot() {
lockForRegularUsage();
try {
return new Snapshot(values.values());
} finally {
unlockForRegularUsage();
}
}
代码示例来源:origin: stackoverflow.com
@ReadingConverter
public class SnapshotReadingConverter implements Converter<DBObject, Snapshot> {
@Override
public Snapshot convert(DBObject source) {
long id = (Long) source.get("_id");
String description = (String) source.get("description");
boolean active = (Boolean) source.get("active");
boolean billable = false;
if (source.get("billable") != null) {
billable = (Boolean) source.get("billable");
}
return new Snapshot(id, description, active, billable);
}
}
内容来源于网络,如有侵权,请联系作者删除!