Sha256: d54f164e2afcd95ecd27316f3b6a5914b0ae4b3043475f1568f26bf7b728939c

Contents?: true

Size: 538 Bytes

Versions: 3

Compression:

Stored size: 538 Bytes

Contents

#!/usr/bin/env ruby

require "rubygems"
require "bundler/setup"

require 'optparse'
require "simple_metrics"

ts = Time.now.to_i

name = "test.post.clicks2"

SimpleMetrics::Mongo.ensure_collections_exist

SimpleMetrics::Bucket.all.each do |bucket|
	ts_bucket = bucket.ts_bucket(ts)

	previous_value = rand(300)
	(1..100).each do |index|
		ts = ts_bucket - (bucket.seconds*index)
		value = previous_value+rand(20)
		data_point = SimpleMetrics::DataPoint.create_counter(:name => name, :value => value)
		bucket.save(data_point, ts)
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
simple_metrics-0.4.0 bin/populate
simple_metrics-0.2.3 bin/populate
simple_metrics-0.2.2 bin/populate