Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tdev_metrics

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tdev_metrics

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

TDMetrics

Ruby gem to send metrics to TDMetrics.

Build Status

Installation

Add this line to your application's Gemfile:

gem 'tdev_metrics'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tdev_metrics

Usage

require 'tdev_metrics'

td_metrics = TotenDev::Metrics.new do |c|
  c.username = 'username'
  c.password = 'password'
  c.base_url = 'http://example.com'
end


# Project Management
# create a new project
td_metrics.project.create 'MyNewProject'

# Update a project
td_metrics.project.update <PROJECT_ID>, 'NewProjectName'

# Delete a project
td_metrics.project.delete <PROJECT_ID>

# List all projects
td_metrics.project.list

# List one project
td_metrics.project.list <PROJECT_ID>


# Metrics Management
# Create a new metric
# from hash:
metric_hash = {
                'metric'    => 'my metric',
                'project'   => 1,
                'place'     => 'my place',
                'type'      => 'my type',
                'info'      => 'my info',
                'timestamp' => 1356145931
              }

metric = TotenDev::Metric.new metric_hash
# you can also set values from attributes
# ie:
metric.timestamp = Time.new.getutc.to_i
# send values to server:
td_metrics.metric.create metric

# Update a metric
td_metrics.metric.update <METRIC_ID>, metric

# Delete a metric
td_metrics.metric.delete <METRIC_ID>

# List all metrics
td_metrics.metric.list
# you can also set some params for the response:
td_metrics.metric.list :all, { :limit => 10, :order => 'desc' }
# or list one metric only:
td_metrics.metric.list <METRIC_ID>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

MIT

FAQs

Package last updated on 16 Jul 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc