artillery-engine-posthog

0.0.1 • Public • Published

Artillery Engine for PostHog

PostHog logo

PostHog is an open-source product analytics platform.

This Artillery engine is designed for users of self-hosted PostHog (Open-Source or PostHog Enterprise). It makes it easy to load test your PostHog deployment to:

  • Make sure the deployment can handle the event volume you're expecting
  • Make sure the deployment can handle bursts in event volumes
  • Take guesswork out of provisioning capacity and make sure that both PostHog and its dependencies (e.g. ClickHouse) are ready to scale

Usage

Install the plugin

npm install -g artillery-engine-posthog

Configuration

  1. Set the address of your PostHog instance with config.target, and set a PostHog API key with config.posthog.apiKey.
  2. Set the engine property of the scenario to posthog.
  3. In your scenario, use:
    • capture to send events to PostHog
    • identify and alias to enrich users metadata

Example Script

config:
  target: "https://posthog.acme.corp"
  posthog:
    apiKey: "{{ $processEnvironment.POSTHOG_API_KEY }}"
  phases:
    - arrivalCount: 5
      duration: 10
  engines:
    posthog: {}
scenarios:
  - name: "posthog engine test"
    engine: posthog
    flow:
      - count: 3
        loop:
        - capture:
            distinctId: "distinct id"
            event: "movie played"
            properties:
              movieId: "Die Hard"
              category: "Christmas"
        - think: 2

(See examples folder for a couple of full examples.)

Run Your Script

POSTHOG_API_KEY=xxx artillery run example.yml

License

MPL 2.0

Readme

Keywords

Package Sidebar

Install

npm i artillery-engine-posthog

Weekly Downloads

170

Version

0.0.1

License

MPL-2.0

Unpacked Size

23.6 kB

Total Files

4

Last publish

Collaborators

  • shoreditch-ops