Chapter 09/circuit-oneops-1-master/components/cookbooks/diagnostic_cache/files/default/couchbase_monitor.rb
#Primary entrance point to collect all metrics from the cluster
Primary entrance point to collect all metrics from the cluster
Primary entrance point to collect all metrics from the cluster
def collect_all_stats()
    begin
      logger.info 'collect_all_stats:start: Starting'
      cluster_stats_url = "#{@hostname}/pools/default"
      bucket_stats_url  = "#{@hostname}/pools/default/buckets"
      time = Time.now
      open_tcp_sockets
      cluster_stats(cluster_stats_url, time)
      bucket_stats(bucket_stats_url, time)
      ping_stats(cluster_stats_url, time)
      close_tcp_sockets
      logger.info 'collect_all_stats:end: Completed'
    rescue Exception => e
      logger.error "collect_all_stats:exception: #{e}"
    end
  end
def collect_all_stats ( ) begin logger . info 'collect_all_stats:start: Starting' cluster_stats_url = "#{@hostname}/pools/default" bucket_stats_url = "#{@hostname}/pools/default/buckets" time = Time . now open_tcp_sockets cluster_stats ( cluster_stats_url , time ) bucket_stats ( bucket_stats_url , time ) ping_stats ( cluster_stats_url , time ) close_tcp_sockets logger . info 'collect_all_stats:end: Completed' rescue Exception => e logger . error "collect_all_stats:exception: #{e}" end end
Primary entrance point to collect all metrics from the cluster
Primary entrance point to collect all metrics from the cluster