Module: StatsCloud

Extended by:
LoggerHelper
Defined in:
lib/statscloud.rb,
lib/statscloud/version.rb,
lib/statscloud/cluster_client.rb,
lib/statscloud/statscloud_client.rb,
lib/statscloud/statsmeter_client.rb,
lib/statscloud/errors/client_error.rb,
lib/statscloud/helpers/event_helper.rb,
lib/statscloud/helpers/assets_helper.rb,
lib/statscloud/helpers/logger_helper.rb,
lib/statscloud/helpers/plugins_helper.rb,
lib/statscloud/helpers/socketio_helper.rb,
lib/statscloud/helpers/statscloud_helper.rb,
lib/statscloud/helpers/statsmeter_helper.rb,
lib/generators/stats_cloud/install_generator.rb,
lib/statscloud/helpers/parsed_response_helper.rb

Overview

StatsCloud.io ruby client

Defined Under Namespace

Modules: AssetsHelper, EventHelper, LoggerHelper, PluginsHelper, SocketIOHelper, StatsCloudHelper, StatsmeterHelper Classes: Client, ClusterClient, InstallGenerator, ParsedResponseHelper, StatsmeterClient

Constant Summary collapse

VERSION =

version of statscloud-ruby-client.

Type: String

"1.0.4"
ClientError =
Class.new(StandardError)

Class Method Summary collapse

Methods included from LoggerHelper

logger

Class Method Details

.cluster_statusHash

Returns cluster status.

Returns:

  • (Hash)


62
63
64
65
66
# File 'lib/statscloud.rb', line 62

def cluster_status
  StatsCloud::Client.instance.cluster_status
rescue StandardError => error
  logger.error error
end

.meterStatsCloud::StatsmeterClient

Returns statscloud.io client aka Statsmeter client



51
52
53
54
55
# File 'lib/statscloud.rb', line 51

def meter
  StatsCloud::Client.instance.meter
rescue StandardError => error
  logger.error error
end

.start(base_config = nil) ⇒ Thread

Configures statsmeter.io support for application and initializes a statscloud.io client.

Parameters:

  • env (+String+)

    statsmeter.io cluster environment

  • base_config (+Hash+) (defaults to: nil)

    statsmeter.io configuration

Returns:

  • (Thread)


22
23
24
25
26
# File 'lib/statscloud.rb', line 22

def start(base_config = nil)
  StatsCloud::Client.instance.start(base_config)
rescue StandardError => error
  logger.error error
end

.stopNilClass

Stops statscloud.io service.

Returns:

  • (NilClass)


73
74
75
76
77
# File 'lib/statscloud.rb', line 73

def stop
  StatsCloud::Client.instance.stop
rescue StandardError => error
  logger.error error
end

.with_environment(env) ⇒ Object

Configures Statscloud environment.

Returns:

  • StatsCloud::Client



31
32
33
34
35
# File 'lib/statscloud.rb', line 31

def with_environment(env)
  StatsCloud::Client.instance.with_environment(env)
rescue StandardError => error
  logger.error error
end

.with_tags(tags) ⇒ Object

Configures Statscloud tags.

Returns:

  • StatsCloud::Client



40
41
42
43
44
# File 'lib/statscloud.rb', line 40

def with_tags(tags)
  StatsCloud::Client.instance.with_tags(tags)
rescue StandardError => error
  logger.error error
end