simple_metrics 0.3.6 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +53 -16
- data/Rakefile +0 -17
- data/bin/populate +13 -26
- data/bin/simple_metrics_client +64 -0
- data/bin/simple_metrics_server +3 -4
- data/lib/simple_metrics.rb +76 -17
- data/lib/simple_metrics/bucket.rb +106 -43
- data/lib/simple_metrics/client.rb +83 -0
- data/lib/simple_metrics/data_point.rb +137 -45
- data/lib/simple_metrics/functions.rb +5 -5
- data/lib/simple_metrics/graph.rb +32 -69
- data/lib/simple_metrics/mongo.rb +48 -0
- data/lib/simple_metrics/server.rb +66 -0
- data/lib/simple_metrics/version.rb +1 -1
- data/simple_metrics.gemspec +0 -6
- data/spec/bucket_spec.rb +152 -17
- data/spec/data_point_spec.rb +64 -14
- data/spec/graph_spec.rb +19 -30
- data/spec/spec_helper.rb +3 -3
- metadata +24 -139
- data/.travis.yml +0 -3
- data/bin/simple_metrics_web +0 -11
- data/config.ru +0 -6
- data/default_config.yml +0 -34
- data/lib/simple_metrics/app.rb +0 -52
- data/lib/simple_metrics/configuration.rb +0 -97
- data/lib/simple_metrics/data_point/base.rb +0 -59
- data/lib/simple_metrics/data_point/counter.rb +0 -20
- data/lib/simple_metrics/data_point/event.rb +0 -16
- data/lib/simple_metrics/data_point/gauge.rb +0 -19
- data/lib/simple_metrics/data_point/timing.rb +0 -15
- data/lib/simple_metrics/data_point_repository.rb +0 -114
- data/lib/simple_metrics/importer.rb +0 -64
- data/lib/simple_metrics/metric.rb +0 -29
- data/lib/simple_metrics/metric_repository.rb +0 -54
- data/lib/simple_metrics/public/css/bootstrap-responsive.min.css +0 -12
- data/lib/simple_metrics/public/css/bootstrap.min.css +0 -689
- data/lib/simple_metrics/public/css/graph.css +0 -45
- data/lib/simple_metrics/public/css/rickshaw.min.css +0 -1
- data/lib/simple_metrics/public/img/glyphicons-halflings-white.png +0 -0
- data/lib/simple_metrics/public/img/glyphicons-halflings.png +0 -0
- data/lib/simple_metrics/public/js/app.js +0 -20
- data/lib/simple_metrics/public/js/collections/graph.js +0 -16
- data/lib/simple_metrics/public/js/collections/metric.js +0 -9
- data/lib/simple_metrics/public/js/helpers.js +0 -23
- data/lib/simple_metrics/public/js/lib/backbone-0.9.2.min.js +0 -38
- data/lib/simple_metrics/public/js/lib/bootstrap.min.js +0 -6
- data/lib/simple_metrics/public/js/lib/d3.v2.min.js +0 -4
- data/lib/simple_metrics/public/js/lib/handlebars-1.0.0.beta.6.js +0 -1550
- data/lib/simple_metrics/public/js/lib/jquery-1.7.1.min.js +0 -4
- data/lib/simple_metrics/public/js/lib/moment.min.js +0 -6
- data/lib/simple_metrics/public/js/lib/rickshaw.min.js +0 -1
- data/lib/simple_metrics/public/js/lib/underscore-1.3.1.min.js +0 -31
- data/lib/simple_metrics/public/js/models/graph.js +0 -6
- data/lib/simple_metrics/public/js/models/metric.js +0 -7
- data/lib/simple_metrics/public/js/router.js +0 -42
- data/lib/simple_metrics/public/js/views/app.js +0 -18
- data/lib/simple_metrics/public/js/views/dashboard.js +0 -10
- data/lib/simple_metrics/public/js/views/graph.js +0 -101
- data/lib/simple_metrics/public/js/views/metric.js +0 -82
- data/lib/simple_metrics/public/js/views/metrics.js +0 -10
- data/lib/simple_metrics/repository.rb +0 -34
- data/lib/simple_metrics/udp_server.rb +0 -81
- data/lib/simple_metrics/views/graph.erb +0 -93
- data/lib/simple_metrics/views/index.erb +0 -0
- data/lib/simple_metrics/views/layout.erb +0 -138
- data/lib/simple_metrics/views/show.erb +0 -31
- data/spec/data_point_repository_spec.rb +0 -77
- data/spec/importer_spec.rb +0 -126
- data/spec/metric_repository_spec.rb +0 -53
@@ -1,53 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require "spec_helper"
|
3
|
-
|
4
|
-
module SimpleMetrics
|
5
|
-
|
6
|
-
describe MetricRepository do
|
7
|
-
|
8
|
-
before do
|
9
|
-
MetricRepository.truncate_collections
|
10
|
-
end
|
11
|
-
|
12
|
-
let(:ts) do
|
13
|
-
Time.now.utc.to_i
|
14
|
-
end
|
15
|
-
|
16
|
-
describe "#save" do
|
17
|
-
it "saves metric correctly" do
|
18
|
-
metric = Metric.new(:name => "test", :total => 1)
|
19
|
-
MetricRepository.save(metric)
|
20
|
-
|
21
|
-
results = MetricRepository.find_all
|
22
|
-
results.should have(1).metric
|
23
|
-
results.first.name.should == "test"
|
24
|
-
results.first.total.should == 1
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "#find_all" do
|
29
|
-
it "returns all metrics" do
|
30
|
-
metric1 = Metric.new(:name => "test", :total => 1)
|
31
|
-
metric2 = Metric.new(:name => "test2", :total => 1)
|
32
|
-
MetricRepository.save(metric1)
|
33
|
-
MetricRepository.save(metric2)
|
34
|
-
|
35
|
-
results = MetricRepository.find_all
|
36
|
-
results.should have(2).metrics
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "#find_one_by_name" do
|
41
|
-
it "returns all metrics" do
|
42
|
-
metric1 = Metric.new(:name => "test", :total => 1)
|
43
|
-
metric2 = Metric.new(:name => "test2", :total => 1)
|
44
|
-
MetricRepository.save(metric1)
|
45
|
-
MetricRepository.save(metric2)
|
46
|
-
|
47
|
-
result = MetricRepository.find_one_by_name("test")
|
48
|
-
result.name.should == "test"
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end # describe MetricRepository
|
52
|
-
|
53
|
-
end
|