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

vleet

v0.2.5

Published

AirVantage systems fleet simulator

Downloads

1

Readme

Vleet

Virtual fLeet of system simulator for AirVantage platform

Build Status

Usage

Installation

  1. Download & install NodeJS
  2. From the command line, install vleet globally
$ npm install -g vleet

Set up your simulation

Create a folder to store your simulation(s) configuration files

Simulation description

Have a look at simulations/trucks.json.template file to create your own.

Let's say you want to simulate an alarm system, create a alarmSystem.json file in simulations folder. The name of the file will be used to reference your simulation.

Final setup

  1. Create a setup.json out of the setup.json.template file.
  2. Provide the name of the simulation you want to run (name of the one you created in simulations)
  3. Select the AirVantage DataCenter you target: eu or na
  4. Provide your (or a technical user) credentials on the selected AirVantage DataCenter.

Launch the simulation

From the root folder just launch vleet

CLI

$ vleet --help

Usage: vleet [options] <your-setup.json> (default: setup.json)

  Options:

    -h, --help     output usage information
    -V, --version  output the version number
    -c, --clean    Clean the simulated resources (Systems, Gateways, Applications with the "simulationLabel")

Simulation descriptor file

This JSON file (no comments allowed) is used to describe:

  • Your fleet
  • The data to simulate
  • How to simulate those data

This file is divided is multiple blocks. A full example is available as a template: simulations/trucks.json.template

header

General parameters

  • name
  • simulationLabel: Will be added to all the resources that will be created on AirVantage (System, Gateway, Application).
    • :warning: Will be used by clean command to delete all the simulated resources.
  • labels(optional): By default each resource is created with the simulationLabel but sometimes you may need to add more than one label. You can provide an array of labels to add.
    • :warning: For the moment you have to include the simulationLabel in that list.

fleet

Fleet description

  • size: number of systems that will be created
  • template: description of the systems
    • namePrefix: Each system will have a name like ${namePrefix}${rank}, e.g. VTruck #1
    • systemType (optional): randomly picked for each system, will be used to retrieve a reference firmware if any. Otherwise, pick one from the "firmware" list if any
      • Array of strings, e.g ["AR7552", "AR6220"]
    • firmware (optional): if no reference firmware has been found pick one from this list
      • Array of string matching application UID, e.g. ["524f332fc46c46b2b92a8cd60acc7156", "6bd26c89baad4deb963b2ac2cc220e1a"]
    • subscription (optional): randomly picked for each system subscriptions
      • e.g { "operators": ["ATT", "Bouygues"] }
      • :bulb: to see the entire list of supported operators, just check https://eu.airvantage.net/api/v1/operators

generation

The simulation behavior

  • mode: One mode available for the moment backToTheFuture :sweat_smile:
    • Go back back in time up to the specified nbDaysInPast and generate valuesPerDay
  • backToTheFuture: set up the generation mode
    • nbDaysInPast
    • valuesPerDay
  • data: define how your systems data should be generated
    • Map of map with the data path as key and the following parameters as value
      • generator: use to generate the data value
        • One of the available generators or custom ones you can develop
      • options: map of options that will be provided to the generator

application (optional)

Provide more info about the data you will simulate by describing an AirVantage application

  • name: name of the application that will be created on AirVantage
  • data
    • Array of data description, with the following parameters
      • id
      • label: Will be displayed in AirVantage, instead of the identifier
      • description: Will be displayed in AirVantage
      • elementType: Just set it to variable for now :sweat_smile:
      • type: double (64bits float), int (32bits signed integer), string (UTF-8 text), boolean, binary and date

Built-in generators

Static value

Nothing fancy here, simply "generate" the given value

{
    "generator": "staticValue",
    "options": {
        "value": 42
    }
}

Random

Random String

By default it will return a string with random length of 5-20 characters and will contain any of the following characters. abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()[]

{
    "generator": "randomString",
    "options": {
        "pool": "abcde",
        "length": 13
    }
}

Random Integer

{
    "generator": "randomInteger",
    "options": {
        "min": -3,
        "max": 4567
    }
}

Random Float

By default it will return a fixed number of at most 4 digits after the decimal.

{
    "generator": "randomFloat",
    "options": {
        "min": -3.456,
        "max": 234.324,
        "fixed": 3
    }
}

Random Boolean

The default likelihood of success (returning true) is 50%. Can optionally specify the likelihood in percent:

{
    "generator": "randomBoolean",
    "options": {
        "likelihood": 30 
    }
}

Increment

Positive or negative incremental generator for both integer and float data

Defaults

  • start: 0
  • step: 1
  • resetThreshold: none
  • precision: 5
 {
    "generator": "incremental",
    "options": {
        "start": 3,
        "step": -0.1,
        "resetThreshold": 2.0,
        "precision": 2
    }
}

Latitude & longitude

Ranges

  • Latitude: -90 to 90
  • Longitude: -180 to 180
{
    "generator": "geoloc",
    "options": {
        "type": "latitude",
        "min": 40.470,
        "max": 40.493
    }
}

Need a custom data generator?

Add them in custom-generators folder which already contains some examples.

:construction: WIP