下面列出了org.apache.commons.lang3.tuple.MutablePair#getKey ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
@Nullable
public String getComment(String path)
{
MutablePair<String, CommentsNodeImpl> nodePair = this.dataMap.get(path);
if (nodePair != null)
{
String comment = nodePair.getLeft();
if (comment != null)
{
return comment;
}
}
MutablePair<String, CommentsNodeImpl> anyNodePair = this.dataMap.get(ANY);
if (anyNodePair != null)
{
return anyNodePair.getKey();
}
return null;
}
public static MutablePair<Double, Double> getSysNetworkTraffic(long samplingWindowInMs)
throws Exception {
MutablePair<Long, Long> startNumbers = getProcNetDevStats();
Thread.sleep(samplingWindowInMs);
MutablePair<Long, Long> endNumbers = getProcNetDevStats();
double inRate = (endNumbers.getKey() - startNumbers.getKey()) * 1000.0 / samplingWindowInMs;
double outRate =
(endNumbers.getValue() - startNumbers.getValue()) * 1000.0 / samplingWindowInMs;
MutablePair<Double, Double> result = new MutablePair<>(inRate, outRate);
return result;
}