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.
Files changed (70) hide show
  1. data/README.markdown +53 -16
  2. data/Rakefile +0 -17
  3. data/bin/populate +13 -26
  4. data/bin/simple_metrics_client +64 -0
  5. data/bin/simple_metrics_server +3 -4
  6. data/lib/simple_metrics.rb +76 -17
  7. data/lib/simple_metrics/bucket.rb +106 -43
  8. data/lib/simple_metrics/client.rb +83 -0
  9. data/lib/simple_metrics/data_point.rb +137 -45
  10. data/lib/simple_metrics/functions.rb +5 -5
  11. data/lib/simple_metrics/graph.rb +32 -69
  12. data/lib/simple_metrics/mongo.rb +48 -0
  13. data/lib/simple_metrics/server.rb +66 -0
  14. data/lib/simple_metrics/version.rb +1 -1
  15. data/simple_metrics.gemspec +0 -6
  16. data/spec/bucket_spec.rb +152 -17
  17. data/spec/data_point_spec.rb +64 -14
  18. data/spec/graph_spec.rb +19 -30
  19. data/spec/spec_helper.rb +3 -3
  20. metadata +24 -139
  21. data/.travis.yml +0 -3
  22. data/bin/simple_metrics_web +0 -11
  23. data/config.ru +0 -6
  24. data/default_config.yml +0 -34
  25. data/lib/simple_metrics/app.rb +0 -52
  26. data/lib/simple_metrics/configuration.rb +0 -97
  27. data/lib/simple_metrics/data_point/base.rb +0 -59
  28. data/lib/simple_metrics/data_point/counter.rb +0 -20
  29. data/lib/simple_metrics/data_point/event.rb +0 -16
  30. data/lib/simple_metrics/data_point/gauge.rb +0 -19
  31. data/lib/simple_metrics/data_point/timing.rb +0 -15
  32. data/lib/simple_metrics/data_point_repository.rb +0 -114
  33. data/lib/simple_metrics/importer.rb +0 -64
  34. data/lib/simple_metrics/metric.rb +0 -29
  35. data/lib/simple_metrics/metric_repository.rb +0 -54
  36. data/lib/simple_metrics/public/css/bootstrap-responsive.min.css +0 -12
  37. data/lib/simple_metrics/public/css/bootstrap.min.css +0 -689
  38. data/lib/simple_metrics/public/css/graph.css +0 -45
  39. data/lib/simple_metrics/public/css/rickshaw.min.css +0 -1
  40. data/lib/simple_metrics/public/img/glyphicons-halflings-white.png +0 -0
  41. data/lib/simple_metrics/public/img/glyphicons-halflings.png +0 -0
  42. data/lib/simple_metrics/public/js/app.js +0 -20
  43. data/lib/simple_metrics/public/js/collections/graph.js +0 -16
  44. data/lib/simple_metrics/public/js/collections/metric.js +0 -9
  45. data/lib/simple_metrics/public/js/helpers.js +0 -23
  46. data/lib/simple_metrics/public/js/lib/backbone-0.9.2.min.js +0 -38
  47. data/lib/simple_metrics/public/js/lib/bootstrap.min.js +0 -6
  48. data/lib/simple_metrics/public/js/lib/d3.v2.min.js +0 -4
  49. data/lib/simple_metrics/public/js/lib/handlebars-1.0.0.beta.6.js +0 -1550
  50. data/lib/simple_metrics/public/js/lib/jquery-1.7.1.min.js +0 -4
  51. data/lib/simple_metrics/public/js/lib/moment.min.js +0 -6
  52. data/lib/simple_metrics/public/js/lib/rickshaw.min.js +0 -1
  53. data/lib/simple_metrics/public/js/lib/underscore-1.3.1.min.js +0 -31
  54. data/lib/simple_metrics/public/js/models/graph.js +0 -6
  55. data/lib/simple_metrics/public/js/models/metric.js +0 -7
  56. data/lib/simple_metrics/public/js/router.js +0 -42
  57. data/lib/simple_metrics/public/js/views/app.js +0 -18
  58. data/lib/simple_metrics/public/js/views/dashboard.js +0 -10
  59. data/lib/simple_metrics/public/js/views/graph.js +0 -101
  60. data/lib/simple_metrics/public/js/views/metric.js +0 -82
  61. data/lib/simple_metrics/public/js/views/metrics.js +0 -10
  62. data/lib/simple_metrics/repository.rb +0 -34
  63. data/lib/simple_metrics/udp_server.rb +0 -81
  64. data/lib/simple_metrics/views/graph.erb +0 -93
  65. data/lib/simple_metrics/views/index.erb +0 -0
  66. data/lib/simple_metrics/views/layout.erb +0 -138
  67. data/lib/simple_metrics/views/show.erb +0 -31
  68. data/spec/data_point_repository_spec.rb +0 -77
  69. data/spec/importer_spec.rb +0 -126
  70. 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