Permalink
Browse files

Add a ServiceData counter with its value taken from config.hdf

Summary:
This adds a setting to the HHVM config that does nothing except make its value
available for query.

Reviewed By: mxw

Differential Revision: D10447229

fbshipit-source-id: 1ad5d9aef944249a5b65b1dcf49dbe88f14ff0fa
  • Loading branch information...
scottfranklin authored and hhvm-bot committed Oct 18, 2018
1 parent 7f0a2e0 commit c48c35c15466d1a5d76b9210ccaf1ccb1d50de85
Showing with 10 additions and 0 deletions.
  1. +9 −0 hphp/runtime/base/runtime-option.cpp
  2. +1 −0 hphp/runtime/base/runtime-option.h
@@ -46,6 +46,7 @@
#include "hphp/util/process.h"
#include "hphp/util/file-cache.h"
#include "hphp/util/log-file-flusher.h"
#include "hphp/util/service-data.h"
#if defined (__linux__) && defined (__aarch64__)
#include <sys/auxv.h>
@@ -88,6 +89,7 @@ namespace HPHP {
std::string RuntimeOption::BuildId;
std::string RuntimeOption::InstanceId;
std::string RuntimeOption::DeploymentId;
int64_t RuntimeOption::ConfigId = 0;
std::string RuntimeOption::PidFile = "www.pid";
bool RuntimeOption::ServerMode = false;
@@ -1007,6 +1009,13 @@ void RuntimeOption::Load(
Config::Bind(PidFile, ini, config, "PidFile", "www.pid");
Config::Bind(DeploymentId, ini, config, "DeploymentId");
{
// Config ID
Config::Bind(ConfigId, ini, config, "ConfigId", 0);
auto configIdCounter = ServiceData::createCounter("vm.config.id");
configIdCounter->setValue(ConfigId);
}
Config::Bind(DynamicInvokeFunctions, ini, config, "DynamicInvokeFunctions",
DynamicInvokeFunctions);
@@ -102,6 +102,7 @@ struct RuntimeOption {
static std::string BuildId;
static std::string InstanceId;
static std::string DeploymentId; // ID for set of instances deployed at once
static int64_t ConfigId; // Queryable to verify a specific config was read
static std::string PidFile;
static std::map<std::string, ErrorLogFileData> ErrorLogs;

0 comments on commit c48c35c

Please sign in to comment.