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

artillery-plugin-hls

v0.0.3

Published

HTTP Live Streaming (HLS) support for Artillery

Downloads

153

Readme

artillery-plugin-hls - load test HLS streaming with Artillery

Description

This plugin adds HTTP Live Streaming (HLS) support to Artillery to make it possible to load test HLS streaming servers. With the plugin enabled, when a request to an M3U8 playlist is made, Artillery will parse the playlist, pick one of the alternative streams, and download its segments (.ts files).

🐞 Please report issues over at https://github.com/shoreditch-ops/artillery/issues

HTTP Live Streaming (HLS)

HTTP Live Streaming (also known as HLS) is an HTTP-based media streaming communications protocol implemented by Apple Inc. as part of its QuickTime, Safari, OS X, and iOS software. Client implementations are also available in Microsoft Edge, Firefox and some versions of Google Chrome. Support is widespread in streaming media servers.

Source: HTTP Live Streaming on Wikipedia

Additional reading:

Usage

Install the plugin

npm install -g artillery-plugin-hls

Load the plugin in your test configuration

config:
  target: "https://video.example.com"
  plugins:
    hls: {}

Make a request to an M3U8 playlist

To stream an HLS-encoded video, make a request to an m3u8 playlist, and set the hls attribute to {} to use the default options, or customize streaming options:

scenarios:
  - name: "Stream an HLS video"
    flow:
      - get:
          url: "/streams/xyz0123/xyz0123.m3u8"
          hls:
            concurrency: 2
            streamSelector:
              resolution:
                width: 320
                height: 184
            throttle: 100

HLS Configuration

The following options are supported on the hls attribute:

  • concurrency - the number of segments to download concurrently; defaults to 4
  • throttle - set to a number (in kb/sec) to throttle bandwidth available to download that stream
  • streamSelector - specify how an alternative stream should be selected; defaults to a random stream.

streamSelector options

  • resolution - set width and height to pick the stream that matches
  • name - set to match on the NAME attribute of a stream
  • bandwidth - set to a number to select a specific bandwidth; or to "min"/"max" to select the lowest/highest bandwidth
  • index - set to a number to select the alternative stream at that index in the playlist, "random" to select a stream at random, or "all" to iterate through all streams.

Reported Metrics

The plugin adds a number of custom metrics to Artillery reports:

  • HLS: segment download started - the number of individual segments (.ts files) requested from the server
  • HLS: segment download completed - the number of segments downloaded
  • HLS: segment download time - the amount of time it's taken to download a segment
  • HLS: stream download time - the amount of time it's taken to download an entire stream

Load Testing HLS at Scale

Streaming video with a large number of virtual users can quickly exhaust all available bandwidth on a single machine. Therefore bandwidth utilization should be monitored closely while tests run to scale out the number of nodes on which Artillery runs as needed.

Artillery Pro provides a solution for running tests from a cluster of nodes easily as well as a number of other team and enterprise-oriented features, and deep AWS integration.

License

Some of the code in this project has been adopted from hls-fetcher, licensed under MIT:

The rest of the code is licensed under MPL-2.0.