summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-03-13 11:58:22 +0000
committerGeir Storli <geirst@oath.com>2018-03-13 12:49:05 +0000
commit89974a6ae0d6112a0a30f01731a23ad7794622f6 (patch)
tree9eee46a8ea4fc85eb3271e8c67e9d8f5a5aa37a9 /storage
parentfd2b9eb63a0ac58cedf9addee2235d329b4a4477 (diff)
Remove never used per storage node ops latencies in host info.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/distributor/distributor_host_info_reporter_test.cpp101
-rw-r--r--storage/src/vespa/storage/distributor/distributor.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/distributor_host_info_reporter.cpp30
-rw-r--r--storage/src/vespa/storage/distributor/distributor_host_info_reporter.h4
4 files changed, 19 insertions, 118 deletions
diff --git a/storage/src/tests/distributor/distributor_host_info_reporter_test.cpp b/storage/src/tests/distributor/distributor_host_info_reporter_test.cpp
index 64df05acb8f..df01b3e30a7 100644
--- a/storage/src/tests/distributor/distributor_host_info_reporter_test.cpp
+++ b/storage/src/tests/distributor/distributor_host_info_reporter_test.cpp
@@ -21,19 +21,13 @@ using Object = vespalib::JsonStream::Object;
class DistributorHostInfoReporterTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(DistributorHostInfoReporterTest);
- CPPUNIT_TEST(hostInfoWithPutLatenciesOnly);
- CPPUNIT_TEST(hostInfoAllInfo);
- CPPUNIT_TEST(generateExampleJson);
- CPPUNIT_TEST(noReportGeneratedIfDisabled);
+ CPPUNIT_TEST(min_replica_stats_are_reported);
+ CPPUNIT_TEST(generate_example_json);
+ CPPUNIT_TEST(no_report_generated_if_disabled);
CPPUNIT_TEST(bucket_spaces_stats_are_reported);
CPPUNIT_TEST_SUITE_END();
- void hostInfoWithPutLatenciesOnly();
- void hostInfoAllInfo();
- void verifyReportedNodeLatencies(const vespalib::Slime& root,
- uint16_t nodeIndex,
- int64_t latencySum,
- int64_t count);
+ void min_replica_stats_are_reported();
void verifyBucketSpaceStats(const vespalib::Slime& root,
uint16_t nodeIndex,
const vespalib::string& bucketSpaceName,
@@ -42,8 +36,8 @@ class DistributorHostInfoReporterTest : public CppUnit::TestFixture
void verifyBucketSpaceStats(const vespalib::Slime& root,
uint16_t nodeIndex,
const vespalib::string& bucketSpaceName);
- void generateExampleJson();
- void noReportGeneratedIfDisabled();
+ void generate_example_json();
+ void no_report_generated_if_disabled();
void bucket_spaces_stats_are_reported();
};
@@ -53,25 +47,7 @@ using ms = std::chrono::milliseconds;
namespace {
-OperationStats
-makeOpStats(std::chrono::milliseconds totalLatency, uint64_t numRequests)
-{
- OperationStats stats;
- stats.totalLatency = totalLatency;
- stats.numRequests = numRequests;
- return stats;
-}
-
// My kingdom for GoogleMock!
-struct MockedLatencyStatisticsProvider : LatencyStatisticsProvider
-{
- NodeStatsSnapshot returnedSnapshot;
-
- NodeStatsSnapshot doGetLatencyStatistics() const override {
- return returnedSnapshot;
- }
-};
-
struct MockedMinReplicaProvider : MinReplicaProvider
{
std::unordered_map<uint16_t, uint32_t> minReplica;
@@ -110,12 +86,6 @@ getMinReplica(const vespalib::Slime& root, uint16_t nodeIndex)
}
const vespalib::slime::Inspector&
-getLatenciesForNode(const vespalib::Slime& root, uint16_t nodeIndex)
-{
- return getNode(root, nodeIndex)["ops-latency"];
-}
-
-const vespalib::slime::Inspector&
getBucketSpaceStats(const vespalib::Slime& root, uint16_t nodeIndex, const vespalib::string& bucketSpaceName)
{
const auto& bucketSpaces = getNode(root, nodeIndex)["bucket-spaces"];
@@ -130,18 +100,6 @@ getBucketSpaceStats(const vespalib::Slime& root, uint16_t nodeIndex, const vespa
}
void
-DistributorHostInfoReporterTest::verifyReportedNodeLatencies(const vespalib::Slime& root,
- uint16_t nodeIndex,
- int64_t latencySum,
- int64_t count)
-{
- auto& latencies = getLatenciesForNode(root, nodeIndex);
- CPPUNIT_ASSERT_EQUAL(latencySum,
- latencies["put"]["latency-ms-sum"].asLong());
- CPPUNIT_ASSERT_EQUAL(count, latencies["put"]["count"].asLong());
-}
-
-void
DistributorHostInfoReporterTest::verifyBucketSpaceStats(const vespalib::Slime& root,
uint16_t nodeIndex,
const vespalib::string& bucketSpaceName,
@@ -164,43 +122,21 @@ DistributorHostInfoReporterTest::verifyBucketSpaceStats(const vespalib::Slime& r
}
struct Fixture {
- MockedLatencyStatisticsProvider latencyStatsProvider;
MockedMinReplicaProvider minReplicaProvider;
MockedBucketSpacesStatsProvider bucketSpacesStatsProvider;
DistributorHostInfoReporter reporter;
Fixture()
- : latencyStatsProvider(),
- minReplicaProvider(),
+ : minReplicaProvider(),
bucketSpacesStatsProvider(),
- reporter(latencyStatsProvider, minReplicaProvider, bucketSpacesStatsProvider)
+ reporter(minReplicaProvider, bucketSpacesStatsProvider)
{}
~Fixture() {}
};
void
-DistributorHostInfoReporterTest::hostInfoWithPutLatenciesOnly()
+DistributorHostInfoReporterTest::min_replica_stats_are_reported()
{
Fixture f;
- NodeStatsSnapshot snapshot;
- snapshot.nodeToStats[0] = { makeOpStats(ms(10000), 3) };
- snapshot.nodeToStats[5] = { makeOpStats(ms(25000), 7) };
-
- f.latencyStatsProvider.returnedSnapshot = snapshot;
-
- vespalib::Slime root;
- util::reporterToSlime(f.reporter, root);
- verifyReportedNodeLatencies(root, 0, 10000, 3);
- verifyReportedNodeLatencies(root, 5, 25000, 7);
-}
-
-void
-DistributorHostInfoReporterTest::hostInfoAllInfo()
-{
- Fixture f;
- NodeStatsSnapshot latencySnapshot;
- latencySnapshot.nodeToStats[0] = { makeOpStats(ms(10000), 3) };
- latencySnapshot.nodeToStats[5] = { makeOpStats(ms(25000), 7) };
- f.latencyStatsProvider.returnedSnapshot = latencySnapshot;
std::unordered_map<uint16_t, uint32_t> minReplica;
minReplica[0] = 2;
@@ -209,21 +145,15 @@ DistributorHostInfoReporterTest::hostInfoAllInfo()
vespalib::Slime root;
util::reporterToSlime(f.reporter, root);
- verifyReportedNodeLatencies(root, 0, 10000, 3);
- verifyReportedNodeLatencies(root, 5, 25000, 7);
CPPUNIT_ASSERT_EQUAL(2, getMinReplica(root, 0));
CPPUNIT_ASSERT_EQUAL(9, getMinReplica(root, 5));
}
void
-DistributorHostInfoReporterTest::generateExampleJson()
+DistributorHostInfoReporterTest::generate_example_json()
{
Fixture f;
- NodeStatsSnapshot snapshot;
- snapshot.nodeToStats[0] = { makeOpStats(ms(10000), 3) };
- snapshot.nodeToStats[5] = { makeOpStats(ms(25000), 7) };
- f.latencyStatsProvider.returnedSnapshot = snapshot;
std::unordered_map<uint16_t, uint32_t> minReplica;
minReplica[0] = 2;
@@ -261,16 +191,15 @@ DistributorHostInfoReporterTest::generateExampleJson()
}
void
-DistributorHostInfoReporterTest::noReportGeneratedIfDisabled()
+DistributorHostInfoReporterTest::no_report_generated_if_disabled()
{
Fixture f;
f.reporter.enableReporting(false);
- NodeStatsSnapshot snapshot;
- snapshot.nodeToStats[0] = { makeOpStats(ms(10000), 3) };
- snapshot.nodeToStats[5] = { makeOpStats(ms(25000), 7) };
-
- f.latencyStatsProvider.returnedSnapshot = snapshot;
+ std::unordered_map<uint16_t, uint32_t> minReplica;
+ minReplica[0] = 2;
+ minReplica[5] = 9;
+ f.minReplicaProvider.minReplica = minReplica;
vespalib::Slime root;
util::reporterToSlime(f.reporter, root);
diff --git a/storage/src/vespa/storage/distributor/distributor.cpp b/storage/src/vespa/storage/distributor/distributor.cpp
index ca0ca80bb4e..d698d07fa34 100644
--- a/storage/src/vespa/storage/distributor/distributor.cpp
+++ b/storage/src/vespa/storage/distributor/distributor.cpp
@@ -96,7 +96,7 @@ Distributor::Distributor(DistributorComponentRegister& compReg,
_maintenanceStats(),
_bucketSpacesStats(),
_bucketDbStats(),
- _hostInfoReporter(_pendingMessageTracker.getLatencyStatisticsProvider(), *this, *this),
+ _hostInfoReporter(*this, *this),
_ownershipSafeTimeCalc(
std::make_unique<OwnershipTransferSafeTimePointCalculator>(
std::chrono::seconds(0))) // Set by config later
diff --git a/storage/src/vespa/storage/distributor/distributor_host_info_reporter.cpp b/storage/src/vespa/storage/distributor/distributor_host_info_reporter.cpp
index 8d2e45655d2..3a588179eb9 100644
--- a/storage/src/vespa/storage/distributor/distributor_host_info_reporter.cpp
+++ b/storage/src/vespa/storage/distributor/distributor_host_info_reporter.cpp
@@ -20,11 +20,9 @@ using Array = vespalib::JsonStream::Array;
using End = vespalib::JsonStream::End;
DistributorHostInfoReporter::DistributorHostInfoReporter(
- LatencyStatisticsProvider& latencyProvider,
MinReplicaProvider& minReplicaProvider,
BucketSpacesStatsProvider& bucketSpacesStatsProvider)
- : _latencyProvider(latencyProvider),
- _minReplicaProvider(minReplicaProvider),
+ : _minReplicaProvider(minReplicaProvider),
_bucketSpacesStatsProvider(bucketSpacesStatsProvider),
_enabled(true)
{
@@ -33,16 +31,6 @@ DistributorHostInfoReporter::DistributorHostInfoReporter(
namespace {
void
-writeOperationStats(vespalib::JsonStream& stream,
- const OperationStats& stats)
-{
- stream << "put" << Object()
- << "latency-ms-sum" << stats.totalLatency.count()
- << "count" << stats.numRequests
- << End();
-}
-
-void
writeBucketSpacesStats(vespalib::JsonStream& stream,
const BucketSpacesStats& stats)
{
@@ -60,14 +48,10 @@ writeBucketSpacesStats(vespalib::JsonStream& stream,
void
outputStorageNodes(vespalib::JsonStream& output,
- const unordered_map<uint16_t, NodeStats>& nodeStats,
const unordered_map<uint16_t, uint32_t>& minReplica,
const PerNodeBucketSpacesStats& bucketSpacesStats)
{
set<uint16_t> nodes;
- for (const auto& element : nodeStats) {
- nodes.insert(element.first);
- }
for (const auto& element : minReplica) {
nodes.insert(element.first);
}
@@ -80,15 +64,6 @@ outputStorageNodes(vespalib::JsonStream& output,
{
output << "node-index" << node;
- auto nodeStatsIt = nodeStats.find(node);
- if (nodeStatsIt != nodeStats.end()) {
- output << "ops-latency" << Object();
- {
- writeOperationStats(output, nodeStatsIt->second.puts);
- }
- output << End();
- }
-
auto minReplicaIt = minReplica.find(node);
if (minReplicaIt != minReplica.end()) {
output << "min-current-replication-factor"
@@ -115,7 +90,6 @@ DistributorHostInfoReporter::report(vespalib::JsonStream& output)
return;
}
- auto nodeStats = _latencyProvider.getLatencyStatistics();
auto minReplica = _minReplicaProvider.getMinReplica();
auto bucketSpacesStats = _bucketSpacesStatsProvider.getBucketSpacesStats();
@@ -123,7 +97,7 @@ DistributorHostInfoReporter::report(vespalib::JsonStream& output)
{
output << "storage-nodes" << Array();
- outputStorageNodes(output, nodeStats.nodeToStats, minReplica, bucketSpacesStats);
+ outputStorageNodes(output, minReplica, bucketSpacesStats);
output << End();
}
diff --git a/storage/src/vespa/storage/distributor/distributor_host_info_reporter.h b/storage/src/vespa/storage/distributor/distributor_host_info_reporter.h
index 3e6a02120c2..f664b44135d 100644
--- a/storage/src/vespa/storage/distributor/distributor_host_info_reporter.h
+++ b/storage/src/vespa/storage/distributor/distributor_host_info_reporter.h
@@ -15,8 +15,7 @@ struct OperationStats;
class DistributorHostInfoReporter : public HostReporter
{
public:
- DistributorHostInfoReporter(LatencyStatisticsProvider& latencyProvider,
- MinReplicaProvider& minReplicaProvider,
+ DistributorHostInfoReporter(MinReplicaProvider& minReplicaProvider,
BucketSpacesStatsProvider& bucketSpacesStatsProvider);
DistributorHostInfoReporter(const DistributorHostInfoReporter&) = delete;
@@ -43,7 +42,6 @@ public:
}
private:
- LatencyStatisticsProvider& _latencyProvider;
MinReplicaProvider& _minReplicaProvider;
BucketSpacesStatsProvider& _bucketSpacesStatsProvider;
std::atomic<bool> _enabled;