summaryrefslogtreecommitdiffstats
path: root/ui/imports/api
diff options
context:
space:
mode:
Diffstat (limited to 'ui/imports/api')
-rw-r--r--ui/imports/api/configurations/configurations.js2
-rw-r--r--ui/imports/api/messages/server/publications.js16
2 files changed, 17 insertions, 1 deletions
diff --git a/ui/imports/api/configurations/configurations.js b/ui/imports/api/configurations/configurations.js
index 067b69f..44cf4ee 100644
--- a/ui/imports/api/configurations/configurations.js
+++ b/ui/imports/api/configurations/configurations.js
@@ -20,7 +20,7 @@ let schema = {
messages_view_backward_delta: {
type: Number,
minCount: 1,
- defaultValue: '1209600000', // 2 weeks
+ defaultValue: '1209600000', // 14 days
}
};
diff --git a/ui/imports/api/messages/server/publications.js b/ui/imports/api/messages/server/publications.js
index 6b147f0..8c5b59d 100644
--- a/ui/imports/api/messages/server/publications.js
+++ b/ui/imports/api/messages/server/publications.js
@@ -103,6 +103,22 @@ Meteor.publish('messages/count?backDelta&level', function (backDelta, level) {
return new Counter(counterName, Messages.find(query));
});
+Meteor.publish('messages/count?backDelta&level&env', function (backDelta, level, env) {
+ const counterName = `messages/count?backDelta=${backDelta}&level=${level}&env=${env}`;
+ console.log(`subscribe - counter: ${counterName}`);
+
+ let begining = moment().subtract(backDelta);
+ let query = {
+ level: level,
+ environment: env,
+ timestamp: { $gte: begining.toDate() }
+ };
+
+ console.log(`query: ${R.toString(query)}`);
+
+ return new Counter(counterName, Messages.find(query));
+});
+
Meteor.publish('messages/count?level&env', function (level, env) {
const counterName = `messages/count?level=${level}&env=${env}`;
console.log(`subscribe - counter: ${counterName}`);