npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dot4-kpi-repository-client

v1.0.10

Published

clinet library for accessing dot4 kpi repository

Downloads

12

Readme

JavaScript Client Library for dot4 Kpi Repository

Usage - Installation

$ npm install dot4-kpi-repository-js --save

Use library in Node.js

const createClient = requires('dot4-kpi-repository-js');
const config = {
    apiKey: '...', // api key created in dot4
    tenant: '...' // technical mandant
}
const client = createClient(config);

await client.bind();

API

create client

Services

Get all services from kpi repository. Returns an array of all service objects known by the kpi repository.

const services = client.getServices();
// => [{ uid: '3BD256D8-CA6A-41C7-8A47-CB3F92118A85', name: 'service1', ...}]

Technical Services

The state of a service is calculated by the worst state of a technical service assigned to the service. Technical Services are normaly imported from the theGuard! BSM. But they can also be created and updated by an script.

Create a technical service

Creates a new technical Service. Each Technical Service is identified by an UUID:

const technicalService = {
    uid: 'de66eab6-213b-4206-8f49-b37c2f71940b',
	name: 'Technical Service',
	description: "Technical Service created by a script'
}

const createdTechnicalService = client.createTechnicalService(technicalService)

Save state of a technical service

The state of a technical service can be saved for the current time. the timeseries with states of a technical service has a resolution of one Minute. This means you can send the state of the service every Minute.

const technicalServiceKpi = {
    uid: 'de66eab6-213b-4206-8f49-b37c2f71940b',
    state: 1 
}

client.saveTechnicalServiceKpi(technicalServiceKpi);

Custom KPI definitions

Create a new custom KPI Definition:

const definition = {
	name: 'paperCountBW',
  	label: 'Paper Count Black/White',
  	description: 'Kpi Definition for printer service paper count Black/White',
    datatype: 'number',
    storagetype: 'hour',
    isSelected: true,
    color: 'black',
    charttype": 'line'
}

const newKpiDefinition = client.createKpiDefinition(definition);

kpis

Store cutom KPIs for the current timestamp:

const kpi = {
    serviceUid: '3BD256D8-CA6A-41C7-8A47-CB3F92118A85',    
    paperCountBW: 10,
    paperCountColor: 5,    
    maintenancePrinterCount: 2
}

client.saveKpi(kpi)

import kpis