0.0.5 • Published 5 years ago
inspector-amqp v0.0.5
inspector-amqp
Typescript Metrics Reporter for AMQP.
This library is made for inspector-metrics node module and is meant to be used with typescript
/ nodejs
.
It uses amqp-ts as amqp client.
install
npm install --save inspector-amqp
basic usage
import { Event } from "inspector-metrics";
import { AmqpMetricReporter, AmqpTopologyHelper } from "../metrics";
// Instantiate the AMQP reporter
const reporter: AmqpMetricReporter = new AmqpMetricReporter({
amqpTopologyBuilder: AmqpTopologyHelper.queue("amqp://localhost", "queue"),
});
// Create the event
const event = new Event<{}>("test").setValue({
int: 123,
string: "toto",
});
// Report the event
reporter.reportEvent(event);
running rabbitmq locally (using docker)
docker run -d --hostname my-rabbit --name my-rabbit -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 15672:15672 rabbitmq
docker exec my-rabbit rabbitmq-plugins enable rabbitmq_management
releasing / publish docs / publish package
# check functionality
npm i
npm run build
# release
git commit -am "release of a.b.c"
git push
git tag va.b.c
git push --tags
# publish docs
rm -fr docs/
git branch -D gh-pages
git worktree prune
git worktree list
git worktree add -b gh-pages docs origin/gh-pages
npm run publishDocs
# publish package
npm publish