Skip to content
Permalink
Browse files

delete healthlevel from server stats

Summary:
The only way this can be observed is by sending an admin-port command /stats.kvp?keys=health_level.
The value is almost always 0 ("Bold").  When it isn't, knowing the health level without the reason for unhealthiness isn't quite useful.

Reviewed By: markw65

Differential Revision: D13877199

fbshipit-source-id: a9615aee291ce6a094d3e1fe78772943c7730505
  • Loading branch information...
binliu19 authored and hhvm-bot committed Jan 30, 2019
1 parent 8edd693 commit bc3a0f0e004378bb99dd81b38fe7ad94cd4e785d

This file was deleted.

Oops, something went wrong.
@@ -108,7 +108,6 @@ void ServerStats::GetAllKeys(std::set<std::string>& allKeys,
allKeys.insert("load");
allKeys.insert("idle");
allKeys.insert("queued");
allKeys.insert("health_level");
}

void ServerStats::Filter(list<TimeSlot*>& slots, const std::string& keys,
@@ -203,7 +202,6 @@ void ServerStats::Aggregate(list<TimeSlot*>& slots,
auto const load = server->getActiveWorker();
auto const idle = server->getMaxThreadCount() - load;
auto const queued = server->getQueuedJobs();
auto const health_level = (int)ServerStats::m_ServerHealthLevel;

for (auto const& s : slots) {
int sec = (s->m_time == 0 ? slotCount : 1) *
@@ -224,10 +222,6 @@ void ServerStats::Aggregate(list<TimeSlot*>& slots,
values["queued"] = queued;
}

if (wantedKeys.find("health_level") != wantedKeys.end()) {
values["health_level"] = health_level;
}

for (auto const& iter : udfKeys) {
const string& key = iter.first;
int udf = iter.second;
@@ -260,7 +254,6 @@ void ServerStats::FreeSlots(list<TimeSlot*>& slots) {
Mutex ServerStats::s_lock;
std::vector<ServerStats*> ServerStats::s_loggers;
bool ServerStats::s_profile_network = false;
HealthLevel ServerStats::m_ServerHealthLevel = HealthLevel::Bold;
THREAD_LOCAL_NO_CHECK(ServerStats, ServerStats::s_logger);

void ServerStats::LogPage(const string& url, int code) {
@@ -288,10 +281,6 @@ void ServerStats::StartRequest(const char *url, const char *clientIP,
}
}

void ServerStats::SetServerHealthLevel(HealthLevel new_health_level) {
ServerStats::m_ServerHealthLevel = new_health_level;
}

void ServerStats::SetThreadMode(ThreadMode mode) {
ServerStats::s_logger->setThreadMode(mode);
}
@@ -17,16 +17,15 @@
#ifndef incl_HPHP_SERVERSTATS_H_
#define incl_HPHP_SERVERSTATS_H_

#include <set>

#include <curl/curl.h>
#include <time.h>

#include "hphp/runtime/base/execution-profiler.h"
#include "hphp/runtime/base/string-data.h"
#include "hphp/runtime/server/writer.h"
#include "hphp/util/health-monitor-types.h"
#include "hphp/util/lock.h"
#include "hphp/util/thread-local.h"
#include "hphp/runtime/base/execution-profiler.h"
#include "hphp/runtime/server/writer.h"

#include <curl/curl.h>
#include <time.h>

namespace HPHP {
///////////////////////////////////////////////////////////////////////////////
@@ -122,9 +121,6 @@ struct ServerStats {
int64_t m_max; // latest timepoint
CounterMap m_values; // current page's name value pairs

// general health-level of local server
static HealthLevel m_ServerHealthLevel;

void log(const std::string& name, int64_t value);
int64_t get(const std::string& name);
void logPage(const std::string& url, int code);

0 comments on commit bc3a0f0

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.