logstash-input-mongoprofile 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/logstash/inputs/mongoprofile.rb +10 -3
- data/logstash-input-mongoprofile.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4258635451f2deb6f7324bd52337dc7f3423b89
|
4
|
+
data.tar.gz: a7cb17868744643edb9297e9134e82d69f7abeaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a950b0ab5a84a5bb98fff2a3dbae8562ae9f7661888b4312982af2e4f98da2590635aff84d40656864d95cc9b4434acef6853359b1a1c4aec6df2ee804e4339b
|
7
|
+
data.tar.gz: 4be9b66027a6c8461be1ec758a758d7467ec7bef1b497c203a88a47c873cee406e2b96ece65cede232af8c1f7a6745cb0cddbf9ed4940c598f1e063046a00ac6
|
@@ -73,17 +73,22 @@ class MongoAccessor
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def get_documents_by_ts(date, limit)
|
76
|
-
@collection.find({:ts => {:$gt => date}, :client => {:$ne => @client_host}}).limit(limit)
|
76
|
+
@collection.find({:ts => {:$gt => date}, :client => {:$ne => @client_host}}).limit(limit).sort(:ts => -1)
|
77
77
|
end
|
78
78
|
|
79
79
|
def get_documents(limit)
|
80
|
-
@collection.find({:client => {:$ne => @client_host}}).limit(limit)
|
80
|
+
@collection.find({:client => {:$ne => @client_host}}).limit(limit).sort(:ts => -1)
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
84
|
class ProfileCollection
|
85
85
|
def initialize(documents, parser)
|
86
|
-
@documents =
|
86
|
+
@documents = []
|
87
|
+
|
88
|
+
documents.each do |document|
|
89
|
+
@documents.push(document)
|
90
|
+
end
|
91
|
+
|
87
92
|
@parser = parser
|
88
93
|
end
|
89
94
|
|
@@ -152,8 +157,10 @@ class Controller
|
|
152
157
|
last_date_value = @last_value_store.get_last_value
|
153
158
|
|
154
159
|
if last_date_value == ''
|
160
|
+
@logger.info('Getting documents from mongo first time')
|
155
161
|
documents = @mongo_accessor.get_documents(@limit)
|
156
162
|
else
|
163
|
+
@logger.info("Getting documents from mongo start at #{last_date_value}")
|
157
164
|
documents = @mongo_accessor.get_documents_by_ts(last_date_value, @limit)
|
158
165
|
end
|
159
166
|
|