Skip to content

Commit 70ba66f

Browse files
committedSep 3, 2015
Expand $PID in Metrics filename.
1 parent 6d598c9 commit 70ba66f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

Diff for: ‎vm/metrics.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ namespace rubinius {
3939
using namespace utilities;
4040

4141
namespace metrics {
42-
FileEmitter::FileEmitter(MetricsMap& map, std::string path)
42+
FileEmitter::FileEmitter(STATE, MetricsMap& map, std::string path)
4343
: MetricsEmitter()
4444
, metrics_map_(map)
4545
, path_(path)
4646
, fd_(-1)
4747
{
48+
// TODO: Make this a proper feature of the config facility.
49+
state->shared().env()->expand_config_value(
50+
path_, "$PID", state->shared().pid.c_str());
51+
4852
initialize();
4953
}
5054

@@ -254,7 +258,7 @@ namespace rubinius {
254258
state->shared().config.system_metrics_statsd_server.value,
255259
state->shared().config.system_metrics_statsd_prefix.value);
256260
} else if(state->shared().config.system_metrics_target.value.compare("none")) {
257-
emitter_ = new FileEmitter(metrics_map_,
261+
emitter_ = new FileEmitter(state, metrics_map_,
258262
state->shared().config.system_metrics_target.value);
259263
}
260264
}

Diff for: ‎vm/metrics.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ namespace rubinius {
299299
int fd_;
300300

301301
public:
302-
FileEmitter(MetricsMap& map, std::string path);
302+
FileEmitter(STATE, MetricsMap& map, std::string path);
303303
virtual ~FileEmitter();
304304

305305
void send_metrics();

0 commit comments

Comments
 (0)
Please sign in to comment.