lib/sensu/server/tessen.rb
def create_data
        get_install_id do |install_id|
          get_client_count do |client_count|
            get_server_count do |server_count|
              identity_key = @options.fetch(:identity_key, "")
              flavour, version = get_version_info
              timestamp = Time.now.to_i
              data = {
                :tessen_identity_key => identity_key,
                :install => {
                  :id => install_id,
                  :sensu_flavour => flavour,
                  :sensu_version => version
                },
                :metrics => {
                  :points => [
                    {
                      :name => "client_count",
                      :value => client_count,
                      :timestamp => timestamp
                    },
                    {
                      :name => "server_count",
                      :value => server_count,
                      :timestamp => timestamp
                    }
                  ]
                }
              }
              yield data
            end
          end
        end
      end
# Create data to be sent to the Tessen service.
#
# @return [Hash]
Create data to be sent to the Tessen service.
Create data to be sent to the Tessen service .
def create_data
        get_install_id do |install_id|
          get_client_count do |client_count|
            get_server_count do |server_count|
              identity_key = @options.fetch(:identity_key, "")
              flavour, version = get_version_info
              timestamp = Time.now.to_i
              data = {
                :tessen_identity_key => identity_key,
                :install => {
                  :id => install_id,
                  :sensu_flavour => flavour,
                  :sensu_version => version
                },
                :metrics => {
                  :points => [
                    {
                      :name => "client_count",
                      :value => client_count,
                      :timestamp => timestamp
                    },
                    {
                      :name => "server_count",
                      :value => server_count,
                      :timestamp => timestamp
                    }
                  ]
                }
              }
              yield data
            end
          end
        end
      end
def create_data get_install_id do | install_id | get_client_count do | client_count | get_server_count do | server_count | identity_key = @options . fetch ( :identity_key , "" ) flavour , version = get_version_info timestamp = Time . now . to_i data = { :tessen_identity_key => identity_key , :install => { :id => install_id , :sensu_flavour => flavour , :sensu_version => version } , :metrics => { :points => [ { :name => "client_count" , :value => client_count , :timestamp => timestamp } , { :name => "server_count" , :value => server_count , :timestamp => timestamp } ] } } yield data end end end end
Create data to be sent to the Tessen service.
Create data to be sent to the Tessen service .
None
Hash