const ConstElementPtr& /*params*/) {
StatsMgr::instance().removeAll();
return (createAnswer(CONTROL_RESULT_SUCCESS,
- "All statistics removed."));
+ "Warning: statistic-remove-all command is deprecated."
+ " All statistics removed."));
}
ConstElementPtr
void resetAll();
/// @brief Removes all collected statistics.
+ /// @note This command was deprecated.
void removeAll();
/// @brief Returns size of specified statistic.
/// @brief Handles statistic-remove-all command
///
+ /// @note The statistic-remove-all command was deprecated.
+ ///
/// This method handles statistic-remove-all command, which removes all
/// statistics. Params parameter is ignored.
///
int status_code;
ConstElementPtr rep_all = parseAnswer(status_code, rsp);
ASSERT_EQ(0, status_code);
+ ASSERT_TRUE(rep_all);
+ std::string exp = "\"Warning: statistic-remove-all command is deprecated.";
+ exp += " All statistics removed.\"";
+ EXPECT_EQ(exp, rep_all->str());
EXPECT_FALSE(StatsMgr::instance().getObservation("alpha"));
EXPECT_FALSE(StatsMgr::instance().getObservation("beta"));
"access": "write",
"avail": "1.0.0",
"brief": [
- "This command deletes all statistics."
+ "(Deprecated) This command deletes all statistics."
],
"cmd-comment": [
"If the removal of all statistics is successful, the server responds with a status of 0, indicating success, and an empty parameters field. If an error is encountered, the server returns a status code of 1 (error) and the text field contains the error description."