Coder Social home page Coder Social logo

sangwonx / archiverappliance-datasource Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sasaki77/archiverappliance-datasource

0.0 0.0 0.0 10.68 MB

EPICS Archiver Appliance plugin for Grafana dashboard

Home Page: https://sasaki77.github.io/archiverappliance-datasource

License: MIT License

JavaScript 0.14% Go 49.63% TypeScript 49.86% CSS 0.37%

archiverappliance-datasource's Introduction

EPICS Archiver Appliance Datasource

Visualize EPICS Archiver Appliance on Grafana.

Screenshot

See Archiver Appliance site for more information about Archiver Appliance.

Features

  • Select multiple PVs by using Regex (Only supports wildcard pattern like PV.* and alternation pattern like PV(1|2))
  • Legend alias with regular expression pattern
  • Data retrieval with data processing (See Archiver Appliance User Guide for processing of data)
  • Using PV names for Grafana variables
  • Transform your data with processing functions
  • Live update with stream feature
  • Find and notify problems with alerting feature

Installing the plugin

Install using releases

  1. Download a pre-built release from the releases page.

  2. Unzip the contents in the Grafana plugins folder.

  3. This plugin is unsigned. It must be specially listed by name in the Grafana grafana.ini file to allow Grafana to use it. Add sasaki77-archiverappliance-datasource to the allow_loading_unsigned_plugins parameter in the [plugins] section.

Install using Git

Clone this plugin into grafana plugins directory; the default is /var/lib/grafana/plugins.

Configuring the plugin

Please consult [https://sasaki77.github.io/archiverappliance-datasource/configuration.html] for instructions to configure the plugin following installation.

Documentaion

Documentation is available at https://sasaki77.github.io/archiverappliance-datasource.

Configuration

This section lists the available configuration options for the Archiver Appliance data source.

Query editor

Configuration Description
PV Set PV name to be visualized. It is allowed to set multiple PVs by using Regular Expressoins alternation pattern (e.g. (PV:1|PV:2)).
Regex Enable/disable Regex mode. Refer Select Multiple PVs by Regex.
Operator Controls processing of data during data retrieval (Default: mean). Refer Archiver Appliance User Guide about processing of data. Special operator raw and last are also available. raw allows to retrieve the data without processing. last allows to retrieve the last data in the specified time range.
Stream Enable/Disable Stream mode. Stream allows to periodically update the data without refreshing the dashboard. The difference data from the last updated values is only retrieved.
Interval Streaming interval in milliseconds. You can also use a number with unit. e.g. 1s, 1m, 1h. The default is determined by a width of panel and time range.
Capacity The stream data is stored in a circular buffer. Capacity determines the buffer size. The default is detemined by a initial data size.
Alias Set alias for legend.
Alias pattern Set regular expressoin pattern to use PV name for legend alias. Refer Legend Alias with Regex Pattern
Function Apply processing function for retrieved data. Refer Apply Processing Functions

Variables

Variables are supported for PV names registered in Archiver Appliance.

Variables

You can use regular expression pattern same as Query Edit. Only wildcard pattern and alternation pattern are available.

You can also use another variable as a part of query. For example, you have variable group, which is a list of PV name prefixes according to PV naming rules on your institute.

Below is a query in this case.

${group}:.*

Default maximum number of PV names you can use in variables is 100. Limit parameter is available to change maxmum number. Parameters must be follow ? character.

PV:NAME:.*?limit=1000

Development setup

This data source plugin consists of both frontend and backend components.

Front-end Development

Node version v12.x is recommended. If you're new to the Node.js ecosystem, Node Version Manager is a good place to start for managing different Node.js installations and environments.

grafana-toolkit is used to develop the plugin. Please refer grafana-toolkit documentation for more information.

  1. Begin by installing Yarn (https://yarnpkg.com/)
npm install -g yarn
  1. Install dependencies
yarn install
  1. Build plugin in development mode or run in watch mode
yarn dev

or

yarn watch
  1. Build plugin in production mode
yarn build

Back-end Development

If the Mage build tool is not already installed, you may install it using the installation instructions on the Mage homepage

  1. Update Grafana plugin SDK for Go dependency to the latest minor version:
go get -u github.com/grafana/grafana-plugin-sdk-go
  1. Build backend plugin binaries for Linux, Windows and Darwin:
mage -v
  1. List all available Mage targets for additional commands:
mage -l

Test environment with Docker Compose

Thanks to pklaus / docker-archiver-appliance and pklaus / archiver-appliance-with-example-ioc, the test environment is available with Docker Compose.

docker-compose up

The following containers are runinng after docker-compse up.

Name Description
grafana Runs a Grafana server.
archappl Runs a EPICS Archiver Appliance.
redis Runs a datastore for the persistance of the appliance configuration.
example Runs a example EPICS IOC to be archived.

To set up the Archiver Appliance, open http://localhost:17665/mgmt/ui/index.html. You can add the PVs served by the example IOC on this page. Enter the following lines in the input field and then clicking the Archive button. the Archive will be start a few minuites later.

root:circle:tick
root:circle:step
root:circle:period
root:line:b
root:aiExample
root:aiExample1
root:ai1
root:aiExample2
root:ai2
root:aiExample3
root:ai3
root:EXAMPLE:version
root:compressExample
root:circle:angle
root:line:a
root:circle:x
root:circle:y
root:calcExample
root:calcExample1
root:calc1
root:calcExample2
root:calc2
root:calcExample3
root:calc3

Archiver-Appliance-mgmt-page

To add a data source, open Grafana (http://localhost:3000). On the data sources page, add a data source and set URL as http://archappl:17665/retrieval.

test-configuration

The following is a example query with this test environment.

test-query

Build documentation

python -m venv env
source env/bin/activate
pip install sphinx myst-parser sphinx_rtd_theme
make html

Build Status

Build: Status:
Latest release awaiting build
Master Branch awaiting build
Local Master Branch awaiting build
Local Latest Branch awaiting build

archiverappliance-datasource's People

Contributors

sasaki77 avatar n-wbrown avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.