Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
From /$SYS to $SYS.
Browse files Browse the repository at this point in the history
Closes #94.
  • Loading branch information
mcollina committed Feb 18, 2014
1 parent 5daf777 commit 9e3cf37
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Stats.prototype.wire = function wire(server) {

function doPublish(topic, value) {
server.publish({
topic: "/$SYS/" + server.id + "/" + topic,
topic: "$SYS/" + server.id + "/" + topic,
payload: "" + value
});
}
Expand Down
8 changes: 4 additions & 4 deletions test/abstract_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1596,10 +1596,10 @@ module.exports = function(moscaSettings, createConnection) {
buildTest("/test//topic", "/test//topic");
buildTest("/test/+/topic", "/test//topic", false);
buildTest("#", "$SYS/hello", false);
buildTest("/#", "/$SYS/hello", false);
buildTest("/+/hello", "/$SYS/hello", false);
buildTest("/#", "$SYS/hello", false);
buildTest("/+/hello", "$SYS/hello", false);
buildTest("$SYS/hello", "$SYS/hello");
buildTest("$SYS/hello", "$SYS/hello");
buildTest("/$SYS/hello", "/$SYS/hello");
});

it("should allow plugin authors to publish", function(done) {
Expand Down Expand Up @@ -1698,7 +1698,7 @@ module.exports = function(moscaSettings, createConnection) {

it("should publish data each minute", function(done) {
buildAndConnect(done, function(client1) {
var topic = "/$SYS/" + instance.id + "/connectedClients";
var topic = "$SYS/" + instance.id + "/connectedClients";
instance.ascoltatore.subscribe(topic, function(topic, value) {
expect(value).to.eql("1");
client1.disconnect();
Expand Down
10 changes: 5 additions & 5 deletions test/stats_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe("mosca.Stats", function() {
server.emit("clientConnected");

server.on("testPublished", function(packet) {
if (packet.topic === "/$SYS/42/connectedClients") {
if (packet.topic === "$SYS/42/connectedClients") {
expect(packet.payload).to.eql("2");
done();
}
Expand Down Expand Up @@ -84,7 +84,7 @@ describe("mosca.Stats", function() {
server.emit("published");

server.on("testPublished", function(packet) {
if (packet.topic === "/$SYS/42/publishedMessages") {
if (packet.topic === "$SYS/42/publishedMessages") {
expect(packet.payload).to.eql("3");
done();
}
Expand Down Expand Up @@ -134,7 +134,7 @@ describe("mosca.Stats", function() {
var count = 0;

server.on("testPublished", function(packet) {
if (packet.topic === "/$SYS/42/load/15m/" + events[event]) {
if (packet.topic === "$SYS/42/load/15m/" + events[event]) {
count++;

if (++count % 15 === 0) {
Expand Down Expand Up @@ -178,7 +178,7 @@ describe("mosca.Stats", function() {
server.emit(event);

server.on("testPublished", function(packet) {
if (packet.topic === "/$SYS/42/load/1m/" + events[event]) {
if (packet.topic === "$SYS/42/load/1m/" + events[event]) {
expect(packet.payload).to.eql("2");
done();
}
Expand Down Expand Up @@ -219,7 +219,7 @@ describe("mosca.Stats", function() {

server.on("testPublished", function(packet) {
var mem = process.memoryUsage();
if (packet.topic === "/$SYS/42/memory/" + event) {
if (packet.topic === "$SYS/42/memory/" + event) {
expect(packet.payload).to.eql("" + mem[event]);
done();
}
Expand Down

0 comments on commit 9e3cf37

Please sign in to comment.