TS-2483 Add a new metric, proxy.node.restarts.proxy.cache_ready_time
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/09da159b Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/09da159b Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/09da159b Branch: refs/heads/master Commit: 09da159b812e1bedfb1a1f1ebeb0b6814aef0441 Parents: f3baeb2 Author: Leif Hedstrom <[email protected]> Authored: Fri Jan 31 11:13:22 2014 -0700 Committer: Leif Hedstrom <[email protected]> Committed: Fri Jan 31 13:00:52 2014 -0700 ---------------------------------------------------------------------- CHANGES | 5 +++++ mgmt/RecordsConfig.cc | 2 ++ proxy/Main.cc | 4 ++++ 3 files changed, 11 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/09da159b/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 3877c68..230d5c1 100644 --- a/CHANGES +++ b/CHANGES @@ -94,6 +94,11 @@ Changes with Apache Traffic Server 4.2.0 *) [TS-2486] Eliminate SIMPLE_MEMCPY_INIT define. + *) [TS-2483] Add a new metric, proxy.node.restarts.proxy.cache_ready_time, + tracking absolute time when the cache started (finished + initialization). Until cache is available, or no cache configured, this + metric stays at a value of "0". + *) [TS-2476] Fix size_t format string. Author: Radim Kolar <[email protected]> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/09da159b/mgmt/RecordsConfig.cc ---------------------------------------------------------------------- diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index 76028c9..659abe9 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -1374,6 +1374,8 @@ RecordElement RecordsConfig[] = { , {RECT_NODE, "proxy.node.restarts.proxy.start_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL} , + {RECT_NODE, "proxy.node.restarts.proxy.cache_ready_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL} + , {RECT_NODE, "proxy.node.restarts.proxy.stop_time", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL} , {RECT_NODE, "proxy.node.restarts.proxy.restart_count", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL} http://git-wip-us.apache.org/repos/asf/trafficserver/blob/09da159b/proxy/Main.cc ---------------------------------------------------------------------- diff --git a/proxy/Main.cc b/proxy/Main.cc index f224e9b..fd07c09 100644 --- a/proxy/Main.cc +++ b/proxy/Main.cc @@ -399,6 +399,10 @@ CB_After_Cache_Init() Debug("http_listen", "Delayed listen enable, cache initialization finished"); start_HttpProxyServer(); } + + time_t cache_ready_at = time(NULL); + RecSetRecordInt("proxy.node.restarts.proxy.cache_ready_time", cache_ready_at); + // Alert the plugins the cache is initialized. hook = lifecycle_hooks->get(TS_LIFECYCLE_CACHE_READY_HOOK); while (hook) {
