Menu
Scroll for more
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Open source
listStreams
KinesisClient.listStreams([options]) lists the Kinesis streams in the current region.
Parameters
| Parameter | Type | Description |
|---|---|---|
| options | object (optional) | Configuration for the listing operation. |
Options
| Parameter | Type | Description |
|---|---|---|
| exclusiveStartStreamName | string | The name of the stream to start listing from (exclusive). |
| limit | number | The maximum number of streams to return. |
Returns
| Type | Description |
|---|---|
Promise<Object> | A Promise that fulfills with the list of streams. |
Returns object
| Property | Type | Description |
|---|---|---|
| streamNames | Array | An array of stream names. |
| hasMoreStreams | boolean | Indicates if there are more streams to list. |
Example
JavaScript
import {
AWSConfig,
KinesisClient,
} from 'https://jslib.k6.io/aws/0.14.0/kinesis.js';
const awsConfig = new AWSConfig({
region: __ENV.AWS_REGION,
accessKeyId: __ENV.AWS_ACCESS_KEY_ID,
secretAccessKey: __ENV.AWS_SECRET_ACCESS_KEY,
});
const kinesis = new KinesisClient(awsConfig);
export default async function () {
// List all streams
const streams = await kinesis.listStreams();
console.log('Available streams:', streams.streamNames);
console.log('Has more streams:', streams.hasMoreStreams);
// List streams with pagination
const limitedStreams = await kinesis.listStreams({ limit: 5 });
console.log('First 5 streams:', limitedStreams.streamNames);
// List streams starting from a specific stream
if (limitedStreams.hasMoreStreams && limitedStreams.streamNames.length > 0) {
const nextBatch = await kinesis.listStreams({
exclusiveStartStreamName: limitedStreams.streamNames[limitedStreams.streamNames.length - 1],
});
console.log('Next batch of streams:', nextBatch.streamNames);
}
}Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video

Performance testing and observability in Grafana Cloud
Optimize user experiences with Grafana Cloud. Learn real-time insights, performance testing with k6, and continuous validation with Synthetic Monitoring.
Events

User-centered observability: load testing, real user monitoring, and synthetics
Learn how to use load testing, synthetic monitoring, and real user monitoring (RUM) to understand end users' experience of your apps. Watch on demand.