diff options
author | Geir Storli <geirst@oath.com> | 2018-02-22 17:07:18 +0100 |
---|---|---|
committer | Geir Storli <geirst@oath.com> | 2018-02-22 17:07:18 +0100 |
commit | 75519e0e6f6b9d77ad3796367203c6f41e3ae9d6 (patch) | |
tree | 10ec95318849934b96a203ff34f77b4a6016652e /clustercontroller-core/src/main | |
parent | 92553c74190b24aba862bcd8c91815eb4649e43e (diff) |
Remove never used distributor-put-latency metrics from restapiv2.
Diffstat (limited to 'clustercontroller-core/src/main')
8 files changed, 0 insertions, 175 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java index 0ff59c26c13..74ddd941afb 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java @@ -165,19 +165,6 @@ public class ContentCluster { } } - public StorageNodeStats getStorageNodeStats(int storageNodeIndex) { - LatencyStats aggregatePutLatencyStats = new LatencyStats(); - StorageNodeStats aggregateStats = new StorageNodeStats(aggregatePutLatencyStats); - for (DistributorNodeInfo distributor : clusterInfo.getDistributorNodeInfo()) { - StorageNodeStats statsFromDistributor = distributor.getStorageNodeStatsOrNull(storageNodeIndex); - if (statsFromDistributor != null) { - aggregateStats.add(statsFromDistributor); - } - } - - return aggregateStats; - } - /** * Checks if a node can be upgraded * diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/DistributorNodeInfo.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/DistributorNodeInfo.java index 575b965c0e5..a21fbd22213 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/DistributorNodeInfo.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/DistributorNodeInfo.java @@ -15,28 +15,8 @@ import com.yahoo.vespa.clustercontroller.core.hostinfo.StorageNodeStatsBridge; */ public class DistributorNodeInfo extends NodeInfo { - private StorageNodeStatsContainer storageNodeStatsContainer = null; - public DistributorNodeInfo(ContentCluster cluster, int index, String rpcAddress, Distribution distribution) { super(cluster, new Node(NodeType.DISTRIBUTOR, index), false, rpcAddress, distribution); } - @Override - public void setHostInfo(HostInfo hostInfo) { - // This affects getHostInfo(), and makes the host info available through NodeInfo. - super.setHostInfo(hostInfo); - storageNodeStatsContainer = StorageNodeStatsBridge.traverseHostInfo(hostInfo); - } - - /** - * @return Stats this distributor has about a storage node, or null if unknown. - */ - public StorageNodeStats getStorageNodeStatsOrNull(int storageNodeIndex) { - if (storageNodeStatsContainer == null) { - return null; - } - - return storageNodeStatsContainer.get(storageNodeIndex); - } - } diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/LatencyStats.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/LatencyStats.java deleted file mode 100644 index 581cc244a20..00000000000 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/LatencyStats.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.clustercontroller.core; - -/** - * LatencyStats handles adding latencies and counts. - * - * @author hakonhall - */ -public class LatencyStats { - - private long latencyMsSum; - private long count; - - public LatencyStats() { this(0, 0); } - - /** - * @param latencyMsSum The sum of the latencies of all RPCs (or whatever) in milliseconds. - * @param count The number of RPC calls (or whatever). - */ - public LatencyStats(long latencyMsSum, long count) { - this.latencyMsSum = latencyMsSum; - this.count = count; - } - - void add(LatencyStats latencyToAdd) { - latencyMsSum += latencyToAdd.latencyMsSum; - count += latencyToAdd.count; - } - - public long getLatencyMsSum() { return latencyMsSum; } - public long getCount() { return count; } - -} diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/StatsForStorageNodes.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/StatsForStorageNodes.java deleted file mode 100644 index 8df5820bc49..00000000000 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/StatsForStorageNodes.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.clustercontroller.core; - -import java.util.Map; - -/** - * Contains stats for a set of storage nodes. This is used to store the stats returned - * by Distributors from their getnodestate RPCs. The stats for a single storage node - * is represented by the StorageNodeStats class. - * - * @author hakonhall - */ -public class StatsForStorageNodes { - - final private Map<Integer, StorageNodeStats> storageNodesByIndex; - - StatsForStorageNodes(Map<Integer, StorageNodeStats> storageNodesByIndex) { - this.storageNodesByIndex = storageNodesByIndex; - } - - StorageNodeStats getStatsForStorageNode(int nodeIndex) { - return storageNodesByIndex.get(nodeIndex); - } - -} diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/StorageNodeStats.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/StorageNodeStats.java deleted file mode 100644 index d0afc1fa4b7..00000000000 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/StorageNodeStats.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.clustercontroller.core; - -/** - * Contains stats related to a single storage node. - * - * @author hakonhall - */ -public class StorageNodeStats { - - final private LatencyStats distributorPutLatency; - - /** - * @param distributorPutLatency the "put" latency from the point of view of the distributor. - */ - public StorageNodeStats(LatencyStats distributorPutLatency) { this.distributorPutLatency = distributorPutLatency; } - public LatencyStats getDistributorPutLatency() { return distributorPutLatency; } - public void add(StorageNodeStats statsToAdd) { - distributorPutLatency.add(statsToAdd.distributorPutLatency); - } - -} diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/StorageNodeStatsContainer.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/StorageNodeStatsContainer.java deleted file mode 100644 index 1fb24e72218..00000000000 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/StorageNodeStatsContainer.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.clustercontroller.core; - -import java.util.HashMap; -import java.util.Map; - -/** - * Contains stats for a set of storage nodes. This is used to store the stats returned - * by Distributors from their getnodestate RPCs. The stats for a single storage node - * is represented by the StorageNodeStats class. - * - * @author hakonhall - */ -public class StorageNodeStatsContainer { - - final private Map<Integer, StorageNodeStats> storageNodesByIndex = new HashMap<>(); - - public void put(int nodeIndex, StorageNodeStats nodeStats) { - storageNodesByIndex.put(nodeIndex, nodeStats); - } - - public StorageNodeStats get(int nodeIndex) { - return storageNodesByIndex.get(nodeIndex); - } - - public int size() { return storageNodesByIndex.size(); } - -} diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java index 55b7e4bb8c1..30ef0c69fe3 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/hostinfo/StorageNodeStatsBridge.java @@ -16,31 +16,6 @@ public class StorageNodeStatsBridge { private StorageNodeStatsBridge() { } - public static StorageNodeStatsContainer traverseHostInfo(HostInfo hostInfo) { - StorageNodeStatsContainer container = new StorageNodeStatsContainer(); - List<StorageNode> storageNodes = hostInfo.getDistributor().getStorageNodes(); - for (StorageNode storageNode : storageNodes) { - Integer storageNodeIndex = storageNode.getIndex(); - if (storageNodeIndex == null) { - continue; - } - StorageNode.OpsLatency opsLatency = storageNode.getOpsLatenciesOrNull(); - if (opsLatency == null) { - continue; - } - StorageNode.Put putLatency = opsLatency.getPut(); - Long putLatencyMsSum = putLatency.getLatencyMsSum(); - Long putLatencyCount = putLatency.getCount(); - if (putLatencyMsSum == null || putLatencyCount == null) { - continue; - } - LatencyStats putLatencyStats = new LatencyStats(putLatencyMsSum, putLatencyCount); - StorageNodeStats nodeStats = new StorageNodeStats(putLatencyStats); - container.put(storageNodeIndex, nodeStats); - } - return container; - } - public static ContentClusterStats generate(Distributor distributor) { Map<Integer, ContentNodeStats> mapToNodeStats = new HashMap<>(); for (StorageNode storageNode : distributor.getStorageNodes()) { diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/NodeStateRequest.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/NodeStateRequest.java index 9c7143aed4a..669042c2fd8 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/NodeStateRequest.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/NodeStateRequest.java @@ -1,10 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.clustercontroller.core.restapiv2.requests; -import com.yahoo.vespa.clustercontroller.core.LatencyStats; import com.yahoo.vespa.clustercontroller.core.NodeInfo; import com.yahoo.vespa.clustercontroller.core.RemoteClusterControllerTask; -import com.yahoo.vespa.clustercontroller.core.StorageNodeStats; import com.yahoo.vespa.clustercontroller.core.restapiv2.Id; import com.yahoo.vespa.clustercontroller.core.restapiv2.Request; import com.yahoo.vespa.clustercontroller.core.restapiv2.Response; @@ -41,13 +39,6 @@ public class NodeStateRequest extends Request<Response.NodeResponse> { result.addState("unit", new Response.UnitStateImpl(info.getReportedState())); result.addState("user", new Response.UnitStateImpl(info.getWantedState())); - if (info.isStorage() && verboseReports.contains(VerboseReport.STATISTICS)) { - StorageNodeStats storageStats = context.cluster.getStorageNodeStats(info.getNodeIndex()); - LatencyStats latencyStats = storageStats.getDistributorPutLatency(); - result.addMetric("distributor-put-latency-ms-sum", latencyStats.getLatencyMsSum()); - result.addMetric("distributor-put-latency-count", latencyStats.getCount()); - } - for (int i=0; i<info.getReportedState().getDiskCount(); ++i) { Id.Partition partitionId = new Id.Partition(id, i); if (recursive > 0) { |