Add username to shell latency metric and have it go to nan when shell is not connected

This commit is contained in:
Eric Harding committed 2018-07-25 13:20:24 -04:00
1 parent 4d0a9ab56e
commit 8fe151bdb9
4 files changed
+15 -6

No files matched your search

@@ -16,12 +16,14 @@ namespace bts.perf {
readonly ShellLatencyService _service;
readonly string _hostname;
readonly string _version;
readonly string _username;
IDisposable _subs;
[ImportingConstructor]
public ShellLatencyDaemon(ShellLatencyService service) {
public ShellLatencyDaemon(ShellLatencyService service, [Import("username")] string user) {
_service = service;
_version = Configuration.get<bts.config.System>().version;
_username = user;
_hostname = Environment.MachineName;
_subs = _service.subscribei_clock().Subscribe(on_tick);
}
@@ -32,6 +34,7 @@ namespace bts.perf {
_service.report_async(new Report() {
HostName = _hostname,
Version = _version,
User = _username,
Timestamp = tick.Timestamp
});
}