Skip to content

Commit

Permalink
Expand $PID in Metrics filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Sep 3, 2015
1 parent 6d598c9 commit 70ba66f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions vm/metrics.cpp
Expand Up @@ -39,12 +39,16 @@ namespace rubinius {
using namespace utilities;

namespace metrics {
FileEmitter::FileEmitter(MetricsMap& map, std::string path)
FileEmitter::FileEmitter(STATE, MetricsMap& map, std::string path)
: MetricsEmitter()
, metrics_map_(map)
, path_(path)
, fd_(-1)
{
// TODO: Make this a proper feature of the config facility.
state->shared().env()->expand_config_value(
path_, "$PID", state->shared().pid.c_str());

initialize();
}

Expand Down Expand Up @@ -254,7 +258,7 @@ namespace rubinius {
state->shared().config.system_metrics_statsd_server.value,
state->shared().config.system_metrics_statsd_prefix.value);
} else if(state->shared().config.system_metrics_target.value.compare("none")) {
emitter_ = new FileEmitter(metrics_map_,
emitter_ = new FileEmitter(state, metrics_map_,
state->shared().config.system_metrics_target.value);
}
}
Expand Down
2 changes: 1 addition & 1 deletion vm/metrics.hpp
Expand Up @@ -299,7 +299,7 @@ namespace rubinius {
int fd_;

public:
FileEmitter(MetricsMap& map, std::string path);
FileEmitter(STATE, MetricsMap& map, std::string path);
virtual ~FileEmitter();

void send_metrics();
Expand Down

0 comments on commit 70ba66f

Please sign in to comment.