From cae3de162c64d0e93873ad91efacd3474c3e82ca Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Tue, 7 Jul 2015 09:50:58 +0300 Subject: [PATCH 1/3] API: Remove empty line from empty parameters list in storage_service.json Just for styling, empty parameters list will not include an empty line. Signed-off-by: Amnon Heiman --- api/api-doc/storage_service.json | 50 -------------------------------- 1 file changed, 50 deletions(-) diff --git a/api/api-doc/storage_service.json b/api/api-doc/storage_service.json index f38fa0726e..24622f8e6b 100644 --- a/api/api-doc/storage_service.json +++ b/api/api-doc/storage_service.json @@ -19,7 +19,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -82,7 +81,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -102,7 +100,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -122,7 +119,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -142,7 +138,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -162,7 +157,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -179,7 +173,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -196,7 +189,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -216,7 +208,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -233,7 +224,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -342,7 +332,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -359,7 +348,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -379,7 +367,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -396,7 +383,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -459,7 +445,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -538,7 +523,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -779,7 +763,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -796,7 +779,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -861,7 +843,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -878,7 +859,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -925,7 +905,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -942,7 +921,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -959,7 +937,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -976,7 +953,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -988,7 +964,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1120,7 +1095,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1132,7 +1106,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1144,7 +1117,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1161,7 +1133,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1178,7 +1149,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1195,7 +1165,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1207,7 +1176,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1219,7 +1187,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1236,7 +1203,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1248,7 +1214,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1260,7 +1225,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1277,7 +1241,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1289,7 +1252,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1325,7 +1287,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1342,7 +1303,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1378,7 +1338,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1486,7 +1445,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1538,7 +1496,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1555,7 +1512,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1591,7 +1547,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1691,7 +1646,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1708,7 +1662,6 @@ "application/json" ], "parameters":[ - ] } ] @@ -1725,7 +1678,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1761,7 +1713,6 @@ "application/json" ], "parameters":[ - ] }, { @@ -1797,7 +1748,6 @@ "application/json" ], "parameters":[ - ] }, { From 34e60faaca79c9885774f70c3bdb0f8fbb2356fe Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Tue, 7 Jul 2015 09:53:04 +0300 Subject: [PATCH 2/3] API: Adding the storage service metrics definition This adds the storage service metrics that is based on the StorageServiceMetrics class. The following command where added: get_metrics_load get_exceptions get_total_hints_in_progress get_total_hints Signed-off-by: Amnon Heiman --- api/api-doc/storage_service.json | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/api/api-doc/storage_service.json b/api/api-doc/storage_service.json index 24622f8e6b..3a5d5b1c1e 100644 --- a/api/api-doc/storage_service.json +++ b/api/api-doc/storage_service.json @@ -1794,6 +1794,70 @@ ] } ] + }, + { + "path":"/storage_service/metrics/load", + "operations":[ + { + "method":"GET", + "summary":"Get load", + "type":"int", + "nickname":"get_metrics_load", + "produces":[ + "application/json" + ], + "parameters":[ + ] + } + ] + }, + { + "path":"/storage_service/metrics/exceptions", + "operations":[ + { + "method":"GET", + "summary":"Get exceptions", + "type":"int", + "nickname":"get_exceptions", + "produces":[ + "application/json" + ], + "parameters":[ + ] + } + ] + }, + { + "path":"/storage_service/metrics/hints_in_progress", + "operations":[ + { + "method":"GET", + "summary":"Get total hints in progress", + "type":"int", + "nickname":"get_total_hints_in_progress", + "produces":[ + "application/json" + ], + "parameters":[ + ] + } + ] + }, + { + "path":"/storage_service/metrics/total_hints", + "operations":[ + { + "method":"GET", + "summary":"Get total hints", + "type":"int", + "nickname":"get_total_hints", + "produces":[ + "application/json" + ], + "parameters":[ + ] + } + ] } ], "models":{ From 47ce728572279700574932c93d23792acffe7403 Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Tue, 7 Jul 2015 10:07:44 +0300 Subject: [PATCH 3/3] API: Adding a stub implementation for the storage_service metrics This adds a stub implementation for the storge service metrics. The implementation returns the currect type with a stub value. After this patch the following url will be available: /storage_service/metrics/load /storage_service/metrics/exceptions /storage_service/metrics/hints_in_progress /storage_service/metrics/total_hints Signed-off-by: Amnon Heiman --- api/storage_service.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/api/storage_service.cc b/api/storage_service.cc index ebe6095e35..439687c5ed 100644 --- a/api/storage_service.cc +++ b/api/storage_service.cc @@ -577,6 +577,26 @@ void set_storage_service(http_context& ctx, routes& r) { auto debug_threshold = req->get_query_param("throttle"); return make_ready_future(json_void()); }); + + ss::get_metrics_load.set(r, [](std::unique_ptr req) { + //TBD + return make_ready_future(0); + }); + + ss::get_exceptions.set(r, [](std::unique_ptr req) { + //TBD + return make_ready_future(0); + }); + + ss::get_total_hints_in_progress.set(r, [](std::unique_ptr req) { + //TBD + return make_ready_future(0); + }); + + ss::get_total_hints.set(r, [](std::unique_ptr req) { + //TBD + return make_ready_future(0); + }); } }