Change metric names to follow prometheus naming guide
This commit is contained in:
parent
92f0a956b9
commit
d0c1e8cbd9
7 changed files with 22 additions and 22 deletions
|
|
@ -151,13 +151,13 @@ ChatModule.prototype.restrictNewAccount = function restrictNewAccount(user, data
|
|||
};
|
||||
|
||||
const chatIncomingCount = new Counter({
|
||||
name: 'cytube_chat_incoming_count',
|
||||
name: 'cytube_chat_incoming_total',
|
||||
help: 'Number of incoming chatMsg frames'
|
||||
});
|
||||
ChatModule.prototype.handleChatMsg = function (user, data) {
|
||||
var self = this;
|
||||
counters.add("chat:incoming");
|
||||
chatIncomingCount.inc();
|
||||
chatIncomingCount.inc(1, new Date());
|
||||
|
||||
if (!this.channel || !this.channel.modules.permissions.canChat(user)) {
|
||||
return;
|
||||
|
|
@ -288,7 +288,7 @@ ChatModule.prototype.handlePm = function (user, data) {
|
|||
};
|
||||
|
||||
const chatSentCount = new Counter({
|
||||
name: 'cytube_chat_sent_count',
|
||||
name: 'cytube_chat_sent_total',
|
||||
help: 'Number of broadcast chat messages'
|
||||
});
|
||||
ChatModule.prototype.processChatMsg = function (user, data) {
|
||||
|
|
@ -360,7 +360,7 @@ ChatModule.prototype.processChatMsg = function (user, data) {
|
|||
}
|
||||
this.sendMessage(msgobj);
|
||||
counters.add("chat:sent");
|
||||
chatSentCount.inc();
|
||||
chatSentCount.inc(1, new Date());
|
||||
};
|
||||
|
||||
ChatModule.prototype.formatMessage = function (username, data) {
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ PlaylistModule.prototype.sendPlaylist = function (users) {
|
|||
};
|
||||
|
||||
const changeMediaCounter = new Counter({
|
||||
name: 'cytube_playlist_played_count',
|
||||
name: 'cytube_playlist_plays_total',
|
||||
help: 'Counter for number of playlist items played',
|
||||
labelNames: ['shortCode']
|
||||
});
|
||||
|
|
@ -301,7 +301,7 @@ PlaylistModule.prototype.sendChangeMedia = function (users) {
|
|||
var m = this.current.media;
|
||||
this.channel.logger.log("[playlist] Now playing: " + m.title +
|
||||
" (" + m.type + ":" + m.id + ")");
|
||||
changeMediaCounter.labels(m.type).inc();
|
||||
changeMediaCounter.labels(m.type).inc(1, new Date());
|
||||
} else {
|
||||
users.forEach(function (u) {
|
||||
u.socket.emit("setCurrent", uid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue