Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevOps Utils

License GitHub issues Scripts

A collection of standalone operational scripts for Netgrif deployments (databases, infrastructure, etc.). Scripts are grouped by target system in top-level directories and are meant to be run directly against that system — there is no build system, package manager, or shared runtime tying them together.

Contents

mongodb/

  • calculate-usage.js — Reads a deployment's eventLog/eventLogs collection and reports how many workflow events of interest (task finishes, case creations, data set events) occurred over time. Counts are broken down by event type and by calendar month, and printed as CSV.

    Run it with mongosh (or the legacy mongo shell) and redirect stdout to a file:

    mongosh "<connection string>" mongodb/calculate-usage.js > usage.csv
    # or, on older deployments:
    mongo "<connection string>" mongodb/calculate-usage.js > usage.csv

    Compatible with MongoDB 3.6 through the latest server versions. On MongoDB 4.2+ it counts server-side via an aggregation pipeline for performance on very large collections, and automatically falls back to a client-side cursor loop on older servers. Configuration (database name, collection candidates, event class names, batch size, execution strategy, read preference) is controlled via the CONFIG object at the top of the script.

shell/

  • nae-reindex-all.sh — Reindexes Elasticsearch data for every process (Petri net) deployed on a NAE (Netgrif Application Engine) instance. It fetches the list of all process identifiers from /api/petrinet and triggers /api/elastic/reindex for each one in turn.

    Run interactively (prompts for the NAE address, login, and password, each with a default):

    ./shell/nae-reindex-all.sh

    Or in batch mode, supplying NAE, NAE_USER, and NAE_PASS as environment variables instead of prompting:

    NAE="http://localhost:8080" NAE_USER="super@netgrif.com" NAE_PASS="password" ./shell/nae-reindex-all.sh batch

    Requires curl and jq.

  • calculate-event-usage.sh — Estimates how many workflow events a Petriflow process definition (.xml) will generate at runtime, without needing a running NAE instance or database access. Mirrors the Netgrif Platform event usage estimation formula: 1 (case creation) + number of case-level data fields + number of transitions + number of dataRefs anywhere in the process marked editable.

    Accepts a single file or a directory (searched recursively for *.xml), and prints a per-file table plus a total:

    ./shell/calculate-event-usage.sh my-process.xml
    ./shell/calculate-event-usage.sh ./processes/

    Requires xmllint (from libxml2/libxml2-utils).

License

See LICENSE.txt.

About

Repository of collection of tools and scripts when you work with Netgrif Platform

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages