Skip to content

Commit

Permalink
Merge pull request #286 from pantheon-systems/dev-statsd-4
Browse files Browse the repository at this point in the history
Put certain stats on cluster mode
  • Loading branch information
jerryblakley committed May 2, 2016
2 parents cb2d772 + db83ea5 commit 2ce6b70
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ static void session_cleanup(void *s) {

if (!session) return;

stats_counter_cluster("sessions", 1);
stats_counter_cluster("sessions", -1);
stats_timer_cluster("session-duration", time(NULL) - session_start_time);
log_print(LOG_INFO, SECTION_SESSION_DEFAULT, "Destroying cURL handle");

Expand Down Expand Up @@ -496,8 +496,7 @@ void trigger_saint_mode_expired_if_needed(void) {
state_table[saint_state][SAINT_MODE_DURATION_EXPIRED]();
// If we've been in saintmode for longer than saint_mode_warning_threshold, emit a stat saying so.
if (now.tv_sec >= unhealthy_since_timestamp + saint_mode_warning_threshold) {
// TODO JB 'local'
stats_counter("long_running_saint_mode", 1);
stats_counter_cluster("long_running_saint_mode", 1);
log_print(LOG_INFO, SECTION_ENHANCED, "saint_mode active for %d seconds", now.tv_sec-unhealthy_since_timestamp);
}
}
Expand Down Expand Up @@ -1132,8 +1131,7 @@ static CURL *update_session(bool tmp_session) {
// We do this when the thread is initialized. We want the hashtable to survive reinitialization of the handle,
// since the hashtable keeps track of the health status of connections causing the reinitialization

// TODO JB 'local'
stats_counter("sessions", 1);
stats_counter_cluster("sessions", 1);
log_print(LOG_INFO, SECTION_SESSION_DEFAULT, "Opening cURL session");

// if tmp_session, we need to get a new session for this request; otherwise see if we already have a session
Expand Down

0 comments on commit 2ce6b70

Please sign in to comment.