添加链接 注册    登录
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
纯真的木瓜  ·  java实用型-高并发下RestTempla ...·  1 年前    · 
跑龙套的蚂蚁  ·  while循环中的Thread.sleep( ...·  1 年前    · 
谦和的手术刀  ·  R语言入门 :基本数据结构 - ...·  1 年前    · 
耍酷的毛豆  ·  How do I check a git ...·  1 年前    · 
无邪的钢笔  ·  如何在角11.2.0或更低的角度设置Tail ...·  2 年前    · 
link管理  ›  JSON | Grafana k6 documentation
metric test grafana
https://grafana.com/docs/k6/latest/results-output/real-time/json/
怕考试的熊猫
2 月前
Create free account Contact us

Products

Grafana Cloud

Monitor, analyze, and act faster with AI-powered observability.

Grafana Cloud
Grafana Cloud overview

LGTM+ Stack

Grafana Cloud Logs

Logs

powered by Grafana Loki

Grafana

Grafana

for visualization

Grafana Cloud Traces

Traces

powered by Grafana Tempo

Grafana Cloud Metrics

Metrics

powered by Grafana Mimir and Prometheus

Key Capabilities

AI/ML

AI/ML insights

Identify anomalies and reduce toil

Grafana Cloud Asserts

Contextual root cause analysis

Automated anomaly correlation

Grafana SLO

SLO management

Create SLOs and error budget alerts

Grafana Alerting

Alerting

Trigger alerts from any data source

Plugins

Plugins

Connect Grafana to data sources, apps, and more

Observability Solutions

Application Observability

Application Observability

Monitor application performance

Infrastructure Observability

Infrastructure observability

Ensure infrastructure health and performance

Testing

Grafana Cloud k6

Performance testing

Powered by Grafana k6

Synthetic Monitoring

Synthetic Monitoring

powered by Grafana k6

IRM

Incident

Incident response

Routine task automation for incidents

OnCall

On-call management

Flexible on-call management

Open Source

Grafana Loki

Multi-tenant log aggregation system

Grafana

Query, visualize, and alert on data

Grafana Tempo

High-scale distributed tracing backend

Grafana Mimir

Scalable and performant metrics backend

Grafana Pyroscope

Scalable continuous profiling backend

Grafana Beyla

eBPF auto-instrumentation

Grafana Faro

Frontend application observability web SDK

Grafana Alloy

OpenTelemetry Collector distribution with Prometheus pipelines

Grafana k6

Load testing for engineering teams

Prometheus

Monitor Kubernetes and cloud native

OpenTelemetry

Instrument and collect telemetry data

Graphite

Scalable monitoring for time series data

All

Community resources

Dashboard templates

Try out and share prebuilt visualizations

Prometheus exporters

Get your metrics into Prometheus quickly

end-to-end solutions

Opinionated solutions that help you get there easier and faster

Kubernetes Monitoring

Get K8s health, performance, and cost monitoring from cluster to container

Application Observability

Monitor application performance

Frontend Observability

Gain real user monitoring insights

Incident Response & Management

Detect and respond to incidents with a simplified workflow

All monitoring and visualization solutions

monitor infrastructure

Out-of-the-box KPIs, dashboards, and alerts for observability

linux server logo
Linux
windows logo
Windows
docker logo
Docker
postgresql logo
Postgres
mysql logo
MySQL
aws logo
AWS
kafka logo
Kafka
jenkins logo
Jenkins
rabbitmq logo
RabbitMQ
mongodb logo
MongoDB
microsoft azure observability logo
Microsoft Azure
google cloud observability with grafana cloud logo
Google Cloud
All monitoring solutions

visualize any data

Instantly connect all your data sources to Grafana

mongodb logo
MongoDB
appdynamics logo
AppDynamics
oracle database logo
Oracle
gitlab logo
GitLab
jira logo
Jira
salesforce logo
Salesforce
splunk logo
Splunk
datadog logo
Datadog
new relic logo
New Relic
snowflake logo
Snowflake
All visualization solutions

Learn

Community and events

Events

Upcoming in-person and virtual events

ObservabilityCON 2025 (7-9 Oct)

Our flagship observability event

GrafanaCON 2025

Our annual OSS community conference

ObservabilityCON on the Road

Our observability conference on the road

Community

Join the Grafana community

Community forums

Ask the community for help

Resources

Blog

News, releases, cool stories, and more

Observability survey report 2025

Industry insights on the state of observability

Benefits of Observability

New research, reports, and insights

Success stories

By use case, product, and industry

How-to

Documentation

All the docs

Webinars and videos

Demos, webinars, and feature tours

Tutorials

Step-by-step guides

Workshops

Free, in-person or online

Learning Journeys

Expert guidance for mastering our platform

Professional Services

Expert guidance and training

Docs
Pricing

Help build the future of open source observability software Open positions

Check out the open source projects we support Downloads

Sign in

Grafana Cloud

Monitor, analyze, and act faster with AI-powered observability.

Grafana Cloud
Grafana Cloud overview

LGTM+ Stack

Grafana Cloud Logs

Logs

Grafana

Grafana

Grafana Cloud Traces

Traces

Grafana Cloud Metrics

Metrics

Key Capabilities

AI/ML

AI/ML insights

Grafana Cloud Asserts

Contextual root cause analysis

Grafana SLO

SLO management

Grafana Alerting

Alerting

Plugins

Plugins

Observability Solutions

Application Observability

Application Observability

Infrastructure Observability

Infrastructure observability

Testing

Grafana Cloud k6

Performance testing

Synthetic Monitoring

Synthetic Monitoring

IRM

Incident

Incident response

OnCall

On-call management

The actually useful free plan

Grafana Cloud Free Tier
check

10k series Prometheus metrics

check

50GB logs, 50GB traces, 50GB profiles

check

500VUk k6 testing

check

20+ Enterprise data source plugins

check

100+ pre-built solutions

Create account
Grafana Cloud Logs

Grafana Loki

Multi-tenant log aggregation system

Grafana

Grafana

Query, visualize, and alert on data

Grafana Cloud Traces

Grafana Tempo

High-scale distributed tracing backend

Grafana Cloud Metrics

Grafana Mimir

Scalable and performant metrics backend

Grafana Cloud Profiles

Grafana Pyroscope

Scalable continuous profiling backend

Grafana Beyla

eBPF auto-instrumentation

Grafana Faro

Grafana Faro

Frontend application observability web SDK

Grafana Alloy

Grafana Alloy

OpenTelemetry Collector distribution with Prometheus pipelines

Grafana Cloud k6

Grafana k6

Load testing for engineering teams

Prometheus

Prometheus

Monitor Kubernetes and cloud native

OpenTelemetry

OpenTelemetry

Instrument and collect telemetry data

Graphite

Graphite

Scalable monitoring for time series data

All

Community resources

Dashboard templates
Try out and share prebuilt visualizations
Prometheus exporters
Get your metrics into Prometheus quickly

end-to-end solutions

Opinionated solutions that help you get there easier and faster

Kubernetes Monitoring

Kubernetes Monitoring

Get K8s health, performance, and cost monitoring from cluster to container

Application Observability

Application Observability

Monitor application performance

Frontend Observability

Frontend Observability

Gain real user monitoring insights

Incident Response & Management

Incident Response & Management

Detect and respond to incidents with a simplified workflow

monitor infrastructure

Out-of-the-box KPIs, dashboards, and alerts for observability

linux server logo Linux
windows logo Windows
docker logo Docker
postgresql logo Postgres
mysql logo MySQL
aws logo Kafka
jenkins logo Jenkins
rabbitmq logo RabbitMQ
mongodb logo MongoDB
microsoft azure observability logo Microsoft Azure
google cloud observability with grafana cloud logo Google Cloud

visualize any data

Instantly connect all your data sources to Grafana

mongodb logo MongoDB
appdynamics logo AppDynamics
oracle database logo Oracle
gitlab logo GitLab
jira logo Salesforce
splunk logo Splunk
datadog logo Datadog
new relic logo New Relic
snowflake logo Snowflake
All monitoring and visualization solutions

Community and events

Events

ObservabilityCON 2025 (7-9 Oct)

GrafanaCON 2025

ObservabilityCON on the Road

Community

Community forums

Resources

Blog

Observability survey report 2025

Benefits of Observability

Success stories

How-to

Documentation

Webinars and videos

Tutorials

Workshops

Learning Journeys

Professional Services

Featured webinar

Getting started with grafana LGTM stack

Getting started with managing your metrics, logs, and traces using Grafana

Learn how to unify, correlate, and visualize data with dashboards using Grafana.

Learn more →
Site search Ask Grot AI
Technical documentation Plugin catalog
Choose a product
Viewing: v1.2.x (latest) Find another version
  • Grafana k6
    • v0.57.0
    • v0.56.0
    • v0.55.0
    • v0.54.0
    • v0.53.0
    • v0.52.0
    • v0.51.0
    • v0.50.0
    • v0.49.0
    • v0.48.0
    • v0.47.0
      • Troubleshooting
    • Configure your code editor
      • Install k6 Operator
        • Run k6 scripts with TestRun CRD
        • Use k6 Operator with k6 extensions
        • Use the k6 Operator with Grafana Cloud k6
        • Configure the TestRun CRD
        • Schedule k6 tests
        • Use the k6 Operator with Istio
      • Troubleshoot
    • Fine-tune OS
    • Usage collection
    • Write your first test
    • Running k6
    • Results output
    • k6 resources
    • HTTP Requests
      • Built-in metrics
      • Create custom metrics
    • Checks
    • Assertions
    • Thresholds
      • How to use options
      • Options reference
    • Test lifecycle
    • Modules
    • Tags and Groups
    • Cookies
      • HTTP/2
      • WebSockets
      • gRPC
        • Online Certificate Status Protocol (OCSP)
        • SSL/TLS client certificates
        • SSL/TLS version and ciphers
    • Environment variables
    • Execution context variables
        • Graceful stop
        • Arrival-rate VU allocation
        • Dropped iterations
        • Open and closed models
        • Shared iterations
        • Per VU iterations
        • Constant VUs
        • Ramping VUs
        • Constant arrival rate
        • Ramping arrival rate
        • Externally controlled
      • Advanced Examples
      • File
      • Mock
      • Create a test script using the CLI
      • Test builder
        • Using the browser recorder
        • Using the k6 DevTools recorder
        • Using the HAR converter
    • JavaScript and TypeScript mode
    • Write your first browser test
    • Running browser tests
      • Asynchronous operations
      • Interact with elements on your webpage
      • Hybrid approach to performance
      • Page object model
      • Select elements
      • Simulate user input delay
      • Prevent too many time series error
    • Browser metrics
    • Browser options
    • Migrating browser scripts to k6 v0.52
      • Custom summary
      • Amazon CloudWatch
      • Apache Kafka
      • CSV
      • Datadog
      • Dynatrace
      • Elasticsearch
      • Grafana Cloud k6
      • Grafana Cloud Prometheus
      • InfluxDB
      • JSON
      • Netdata
      • New Relic
      • OpenTelemetry
      • Prometheus remote write
      • StatsD
      • TimescaleDB
    • Web dashboard
    • Grafana dashboards
      • Smoke testing
      • Average-load testing
      • Stress testing
      • Soak testing
      • Spike testing
      • Breakpoint testing
    • Automated performance testing
    • API load testing
    • Calculate concurrent users for load tests
    • Load testing websites
    • Performance testing gRPC services
    • Running distributed tests
    • Running large tests
    • Synthetic monitoring
    • Use Chai with k6
      • xk6-disruptor first steps
      • Requirements
      • Installation
      • Expose your application
      • How xk6-disruptor works
          • gRPC
          • HTTP
          • Pod Termination
          • Constructor
          • injectGrpcFaults()
          • injectHTTPFaults()
          • terminatePods()
          • Constructor
          • injectGrpcFaults
          • injectHTTPFaults
          • terminatePods()
        • Inject gRPC faults into Service
        • Inject HTTP faults into Pod
        • Interactive demo
      • open( filePath, [mode] )
      • check( val, sets, [tags] )
      • fail( [err] )
      • group( name, fn )
      • randomSeed( int )
      • sleep( t )
        • addCookies()
        • addInitScript()
        • clearCookies()
        • clearPermissions()
        • close()
        • Cookie
        • cookies([urls])
        • grantPermissions(permissions[, options])
        • newPage()
        • pages()
        • setDefaultNavigationTimeout(timeout)
        • setDefaultTimeout(timeout)
        • setGeolocation(geolocation)
        • setOffline(offline)
        • waitForEvent(event[, optionsOrPredicate])
      • ConsoleMessage
      • MetricMessage
        • $(selector)
        • $$(selector)
        • boundingBox()
        • check([options])
        • click([options])
        • contentFrame()
        • dblclick([options])
        • dispatchEvent(type, eventInit)
        • fill(value, [options])
        • focus()
        • getAttribute(name)
        • hover([options])
        • innerHTML()
        • innerText()
        • inputValue([options])
        • isChecked()
        • isDisabled()
        • isEditable()
        • isEnabled()
        • isHidden()
        • isVisible()
        • ownerFrame
        • press(key, [options])
        • screenshot([options])
        • scrollIntoViewIfNeeded([options])
        • selectOption(values, [options])
        • selectText(values, [options])
        • setChecked(checked[, options])
        • setInputFiles(file[, options])
        • tap(options)
        • textContent()
        • type(text, [options])
        • uncheck([options])
        • waitForElementState(state[, options])
        • waitForSelector(selector[, options])
        • $(selector)
        • $$(selector)
        • check(selector[, options])
        • childFrames()
        • click(selector[, options])
        • content()
        • dblclick(selector[, options])
        • dispatchEvent(selector, type, eventInit[, options])
        • evaluate(pageFunction[, arg])
        • evaluateHandle(pageFunction[, arg])
        • fill(selector, value[, options])
        • focus(selector[, options])
        • frameElement()
        • getAttribute(selector, name[, options])
        • goto(url[, options])
        • hover(selector[, options])
        • innerHTML(selector[, options])
        • innerText(selector[, options])
        • inputValue(selector[, options])
        • isChecked(selector[, options])
        • isDetached()
        • isDisabled(selector[, options])
        • isEditable(selector[, options])
        • isEnabled(selector[, options])
        • isHidden(selector[, options])
        • isVisible(selector[, options])
        • locator(selector)
        • name()
        • page()
        • parentFrame()
        • press(selector, key[, options])
        • selectOption(selector, values[, options])
        • setChecked(selector, checked[, options])
        • setContent(html[, options])
        • setInputFiles(selector, file[, options])
        • tap(selector[, options])
        • textContent(selector[, options])
        • title()
        • type(selector, text[, options])
        • uncheck(selector[, options])
        • url()
        • waitForFunction(pageFunction, arg[, options])
        • waitForLoadState(state[, options])
        • waitForNavigation([options])
        • waitForSelector(selector[, options])
        • waitForTimeout(timeout)
        • waitForURL(url[, options])
        • asElement()
        • dispose()
        • evaluate(pageFunction[, arg])
        • evaluateHandle(pageFunction[, arg])
        • getProperties()
        • jsonValue()
        • down(key)
        • insertText(text)
        • press(key[, options])
        • type(text[, options])
        • up(key)
        • all()
        • check([options])
        • clear([options])
        • click([options])
        • count()
        • dblclick([options])
        • dispatchEvent(type, eventInit, [options])
        • fill(value, [options])
        • first()
        • focus([options])
        • getAttribute(name, [options])
        • hover([options])
        • innerHTML([options])
        • innerText([options])
        • inputValue([options])
        • isChecked([options])
        • isDisabled([options])
        • isEditable([options])
        • isEnabled([options])
        • isHidden()
        • isVisible()
        • last()
        • nth(number)
        • press(key, [options])
        • selectOption(values, [options])
        • setChecked(checked[, options])
        • tap([options])
        • textContent([options])
        • type(text, [options])
        • uncheck([options])
        • waitFor([options])
        • click(x, y[, options])
        • dblclick(x, y[, options])
        • down([options])
        • move(x, y[, options])
        • up([options])
        • $(selector)
        • $$(selector)
        • bringToFront()
        • check(selector[, options])
        • click(selector[, options])
        • close()
        • content()
        • context()
        • dblclick(selector[, options])
        • dispatchEvent(selector, type, eventInit[, options])
        • emulateMedia([options])
        • emulateVisionDeficiency(type)
        • evaluate(pageFunction[, arg])
        • evaluateHandle(pageFunction[, arg])
        • fill(selector, value[, options])
        • focus(selector[, options])
        • frames()
        • getAttribute(selector, name[, options])
        • getByAltText(altText[, options])
        • getByLabel(text[, options])
        • getByPlaceholder(placeholder[, options])
        • getByRole(role[, options])
        • getByTestId(testId)
        • getByText(text[, options])
        • getByTitle(title[, options])
        • goto(url[, options])
        • hover(selector[, options])
        • innerHTML(selector[, options])
        • innerText(selector[, options])
        • inputValue(selector[, options])
        • isChecked(selector[, options])
        • isClosed()
        • isDisabled(selector[, options])
        • isEditable(selector[, options])
        • isEnabled(selector[, options])
        • isHidden(selector[, options])
        • isVisible(selector[, options])
        • keyboard
        • locator(selector)
        • mainFrame()
        • mouse
        • on(event, handler)
        • opener()
        • press(selector, key[, options])
        • reload([options])
        • route(url, handler)
        • screenshot([options])
        • selectOption(selector, values[, options])
        • setChecked(selector, checked[, options])
        • setContent(html[, options])
        • setDefaultNavigationTimeout(timeout)
        • setDefaultTimeout(timeout)
        • setExtraHTTPHeaders(headers)
        • setInputFiles(selector, file[, options])
        • setViewportSize(viewportSize)
        • tap(selector[, options])
        • textContent(selector[, options])
        • throttleCPU(cpuProfile)
        • throttleNetwork(networkProfile)
        • title()
        • touchscreen
        • type(selector, text[, options])
        • uncheck(selector[, options])
        • url()
        • viewportSize()
        • waitForFunction(pageFunction, arg[, options])
        • waitForLoadState(state[, options])
        • waitForNavigation([options])
        • waitForSelector(selector[, options])
        • waitForTimeout(timeout)
        • waitForURL(url[, options])
        • workers()
        • allHeaders()
        • frame()
        • headers()
        • headersArray()
        • headerValue(name)
        • isNavigationRequest()
        • method()
        • postData()
        • postDataBuffer()
        • resourceType()
        • response()
        • size()
        • timing()
        • url()
        • allHeaders()
        • body()
        • frame()
        • headers()
        • headersArray()
        • headerValue(name)
        • headerValues(name)
        • json()
        • ok()
        • request()
        • securityDetails()
        • serverAddr()
        • size()
        • status()
        • statusText()
        • text()
        • url()
        • abort([errorCode])
        • continue([options])
        • fulfill(options)
        • request()
        • tap()
        • url()
      • closeContext()
      • context()
      • isConnected()
      • newContext([options])
      • newPage([options])
      • version()
      • createHash( algorithm )
      • createHMAC( algorithm, secret )
      • hmac( algorithm, secret, data, outputEncoding )
      • md4( input, outputEncoding )
      • md5( input, outputEncoding )
      • randomBytes( int )
      • ripemd160( input, outputEncoding )
      • sha1( input, outputEncoding )
      • sha256( input, outputEncoding )
      • sha384( input, outputEncoding )
      • sha512( input, outputEncoding )
      • sha512_256( input, outputEncoding )
      • sha512_224( input, outputEncoding )
      • Hasher
      • SharedArray
      • b64decode( input, [encoding], [format] )
      • b64encode( input, [encoding] )
    • k6/execution
          • Client.decr(key)
          • Client.decrBy(key, decrement)
          • Client.del(keys)
          • Client.exists(keys)
          • Client.expire(key, seconds)
          • Client.get(key)
          • Client.getDel(key)
          • Client.getSet(key, value)
          • Client.hdel(key, fields)
          • Client.hget(key, field)
          • Client.hgetall(key)
          • Client.hincrby(key, field, increment)
          • Client.hkeys(key)
          • Client.hlen(key)
          • Client.hset(key, field, value)
          • Client.hsetnx(key, field, value)
          • Client.hvals(key)
          • Client.incr(key)
          • Client.incrBy(key, increment)
          • Client.lindex(key)
          • Client.llen(key)
          • Client.lpop(key)
          • Client.lpush(key, values)
          • Client.lrange(key, start, stop)
          • Client.lrem(key, count, value)
          • Client.lset(key, index, element)
          • Client.mget(keys)
          • Client.persist(key)
          • Client.randomKey()
          • Client.rpop(key)
          • Client.rpush(key, values)
          • Client.sadd(key, members)
          • Client.sendCommand(command, args)
          • Client.set(key, value, expiration)
          • Client.sismember(key, member)
          • Client.smembers(key)
          • Client.spop(key)
          • Client.srandmember(key)
          • Client.srem(key, members)
          • Client.ttl(key)
        • Options
        • Blob
          • WebSocket.addEventListener(event, handler)
          • WebSocket.send(data)
          • WebSocket.close([code])
          • WebSocket.ping()
          • WebSocket.onclose
          • WebSocket.onerror
          • WebSocket.onmessage
          • WebSocket.onopen
          • WebSocket.onping
          • WebSocket.onpong
        • Params
        • parse( file, [options] )
        • Parser
        • Options
        • read
        • seek
        • stat
      • open
      • FileInfo
      • SeekMode
        • cancel(reason)
        • getReader()
        • CountQueuingStrategy
        • cancel(reason)
        • read()
        • releaseLock()
        • close()
        • enqueue(chunk)
        • error(reason)
    • parseHTML( src )
      • Element.selection()
      • Selection.attr(name)
      • Selection.children([selector])
      • Selection.closest(selector)
      • Selection.contents()
      • Selection.data([key])
      • Selection.each(fn)
      • Selection.eq(index)
      • Selection.filter(selector)
      • Selection.find(selector)
      • Selection.first()
      • Selection.get(index)
      • Selection.has(selector)
      • Selection.html()
      • Selection.is(selector)
      • Selection.last()
      • Selection.map(fn)
      • Selection.next([selector])
      • Selection.nextAll([selector])
      • Selection.nextUntil([selector], [filter])
      • Selection.not(selector)
      • Selection.parent([selector])
      • Selection.parents([selector])
      • Selection.parentsUntil([selector], [filter])
      • Selection.prev([selector])
      • Selection.prevAll([selector])
      • Selection.prevUntil([selector], [filter])
      • Selection.serialize()
      • Selection.serializeArray()
      • Selection.serializeObject()
      • Selection.size()
      • Selection.slice(start [, end])
      • Selection.text()
      • Selection.toArray()
      • Selection.val()
    • asyncRequest( method, url, [body], [params] )
    • batch( requests )
    • del( url, [body], [params] )
    • file( data, [filename], [contentType] )
    • get( url, [params] )
    • head( url, [params] )
    • options( url, [body], [params] )
    • patch( url, [body], [params] )
    • post( url, [body], [params] )
    • put( url, [body], [params] )
    • request( method, url, [body], [params] )
    • setResponseCallback( callback )
    • url\`url\`
    • expectedStatuses( statuses )
      • CookieJar.clear(url)
      • CookieJar.cookiesForURL(url)
      • CookieJar.delete(url, name)
      • CookieJar.set(url, name, value, [options])
    • FileData
    • Params
      • Response.clickLink( [params] )
      • Response.html()
      • Response.json( [selector] )
      • Response.submitForm( [params] )
      • Counter.add(value, [tags])
      • Gauge.add(value, [tags])
      • Rate.add(value, [tags])
      • Trend.add(value, [tags])
      • Client.load(importPaths, ...protoFiles)
      • Client.loadProtoset(protosetPath)
      • Client.connect(address [,params])
      • Client.asyncInvoke(url, request [,params])
      • Client.invoke(url, request [,params])
      • Client.close()
      • Client.healthCheck()
    • Params
    • Response
      • Stream.on()
      • Error
      • Stream.end()
      • Stream.write()
      • Event Handler
      • Metadata
    • Constants
  • k6/secrets
  • k6/timers
    • connect( url, params, callback )
    • Params
      • Socket.close([code])
      • Socket.on(event, callback)
      • Socket.ping()
      • Socket.send(data)
      • Socket.sendBinary(data)
      • Socket.setInterval(callback, interval)
      • Socket.setTimeout(callback, delay)
  • Error Codes
    • getRandomValues
    • CryptoKey
    • randomUUID
      • decrypt
      • deriveBits
      • digest
      • encrypt
      • exportKey
      • generateKey
      • importKey
      • sign
      • verify
    • AesCbcParams
    • AesCtrParams
    • AesGcmParams
    • RsaOaepParams
    • AesKeyGenParams
    • CryptoKeyPair
    • EcKeyGenParams
    • EcdhKeyDeriveParams
    • EcdsaParams
    • RsaPssParams
    • HmacKeyGenParams
    • RsaHashedImportParams
    • RSAHashedKeyGenParams
    • JsonWebKey
      • AWSConfig
        • putEvents
        • createStream
        • deleteStream
        • getRecords
        • getShardIterator
        • listShards
        • listStreams
        • putRecords
        • generateDataKey
        • listKeys
        • KMSDataKey
        • KMSKey
        • invoke
        • abortMultipartUpload
        • completeMultipartUpload
        • copyObject
        • createMultipartUpload
        • deleteObject
        • getObject
        • listBuckets
        • listObjects
        • putObject
        • uploadPart
        • Bucket
        • Object
        • S3MultipartUpload
        • S3Part
        • S3UploadedObject
        • createSecret
        • deleteSecret
        • getSecret
        • listSecrets
        • putSecretValue
        • Secret
        • presign
        • sign
        • deleteMessage
        • listQueues
        • receiveMessages
        • sendMessage
        • sendMessageBatch
        • getParameter
        • SystemsManagerParameter
      • asyncRequest(method, url, [body], [params])
      • request(method, url, [body], [params])
      • get(url, [body], [params])
      • post(url, [body], [params])
      • put(url, [body], [params])
      • patch(url, [body], [params])
      • delete(url, [body], [params])
      • options(url, [body], [params])
      • head(url, [body], [params])
      • trace(url, [body], [params])
      • batch( requests )
      • setBaseUrl( url )
      • addHeader( key, value )
      • addHeaders( object )
      • clearHeader( name )
      • addTag( key, value )
      • addTags( object )
      • clearTag( name )
      • config
      • describe( name, function )
      • expect()
      • Error handling
      • instrumentHTTP
      • Client
      • instrumentHTTP
      • Client
      • Options
      • randomIntBetween(min, max)
      • randomItem(array)
      • randomString(length, [charset])
      • uuidv4()
      • findBetween(content, left, right, [repeat])
      • normalDistributionStages(maxVus, durationSeconds, [numberOfStages])
      • check( val, sets, [tags] )
      • expect()
      • expect.configure()
        • toBe()
        • toEqual()
        • toContain()
        • toBeTruthy()
        • toBeFalsy()
        • toBeDefined()
        • toBeGreaterThan()
        • toBeCloseTo()
        • toHaveLength()
        • toHaveProperty()
        • toBeGreaterThanOrEqual()
        • toBeLessThan()
        • toBeNull()
        • toBeUndefined()
        • toContainEqual()
        • toBeLessThanOrEqual()
        • toBeInstanceOf()
        • toBeNaN()
        • toBeChecked()
        • toBeDisabled()
        • toBeEditable()
        • toBeHidden()
        • toBeVisible()
        • toHaveText()
        • toContainText()
        • toBeEnabled()
        • toHaveAttribute()
        • toHaveValue()
        • RetryConfig
    • resolve( path )
    • Explore extensions
      • Build a k6 binary using Go
      • Build a k6 binary using Docker
      • Quick start guide
      • Create an extension with a template
      • JavaScript extensions
      • Output extensions
      • Secret source extensions
      • About the Extensions Registry
      • About the Go-to-JS bridge
      • Test for functional behavior
      • Test for performance
      • Analyze results
      • Reuse and re-run tests
    • Single request
    • HTTP Authentication
    • OAuth Authentication
    • Correlation and Dynamic Data
    • Data Parameterization
    • Parse HTML
    • HTML Forms
    • Cookies Example
    • Data Uploads
    • API CRUD Operations
    • Generating UUIDs
    • HTTP2
    • Use global variables in k6
    • WebSockets
    • SOAP
    • Transport Layer Security (TLS)
    • Generating realistic data
    • Bundling and transpiling
    • Functional testing
    • Track transmitted data per URL
    • URLs with query parameters
    • Instant load increase
    • Get timings for an HTTP metric
    • Distribute workloads across VUs
    • Error handler
    • Tutorials
  • Open source

    JSON

    You can output granular data points in JSON format. To do so, use k6 run with the --out flag. Pass the path for your JSON file as the flag argument:

    bash Copy
    k6 run --out json=test_results.json script.js
    docker Copy
    docker run -it --rm \
        -v <scriptdir>:/scripts \
        -v <outputdir>:/jsonoutput \
        grafana/k6 run --out json=/jsonoutput/my_test_result.json /scripts/script.js
    # Note that the docker user must have permission to write to <outputdir>!

    Or if you want to get the result gzipped, like this:

    bash Copy
    k6 run --out json=test_results.gz script.js
    docker Copy
    docker run -it --rm \
        -v <scriptdir>:/scripts \
        -v <outputdir>:/jsonoutput \
        grafana/k6 run --out json=/jsonoutput/my_test_result.gz /scripts/script.js
    # Note that the docker user must have permission to write to <outputdir>!

    To inspect the output in real time, you can use a command like tail -f on the file you save:

    bash Copy
    tail -f test_results.json

    JSON format

    The JSON output has lines as follows:

    json Copy
    {"type":"Metric","data":{"type":"gauge","contains":"default","tainted":null,"thresholds":[],"submetrics":null},"metric":"vus"}
    {"type":"Point","data":{"time":"2017-05-09T14:34:45.625742514+02:00","value":5,"tags":null},"metric":"vus"}
    {"type":"Metric","data":{"type":"trend","contains":"time","tainted":null,"thresholds":["avg<1000"],"submetrics":null},"metric":"http_req_duration"}
    {"type":"Point","data":{"time":"2017-05-09T14:34:45.239531499+02:00","value":459.865729,"tags":{"group":"::my group::json","method":"GET","status":"200","url":"https://quickpizza.grafana.com/api/tools"}},"metric":"http_req_duration"}

    Each line either has information about a metric, or logs a data point (sample) for a metric. Lines consist of three items:

    • type - can have the values Metric or Point where Metric means the line is declaring a metric, and Point is an actual data point (sample) for a metric.
    • data - is a dictionary that contains lots of stuff, varying depending on the "type" above.
    • metric - the name of the metric.

    Metric

    This line has metadata about a metric. Here, "data" contains the following:

    • "type" - the metric type (“gauge”, “rate”, “counter” or “trend”)
    • "contains" - information on the type of data collected (can e.g. be “time” for timing metrics)
    • "tainted" - has this metric caused a threshold to fail?
    • "threshold" - are there any thresholds attached to this metric?
    • "submetrics" - any derived metrics created as a result of adding a threshold using tags.

    Point

    This line has actual data samples. Here, "data" contains these fields:

    • "time" - timestamp when the sample was collected
    • "value" - the actual data sample; time values are in milliseconds
    • "tags" - dictionary with tagname-tagvalue pairs that can be used when filtering results data

    Processing JSON output

    You can use jq to process the k6 JSON output.

    You can quickly create filters to return a particular metric of the JSON file:

    bash Copy
    jq '. | select(.type=="Point" and .metric == "http_req_duration" and .data.tags.status >= "200")' myscript-output.json

    And calculate an aggregated value of any metric:

    bash Copy
    jq '. | select(.type=="Point" and .metric == "http_req_duration" and .data.tags.status >= "200") | .data.value' myscript-output.json | jq -s 'add/length'
    bash Copy
    jq '. | select(.type=="Point" and .metric == "http_req_duration" and .data.tags.status >= "200") | .data.value' myscript-output.json | jq -s min
    bash Copy
    jq '. | select(.type=="Point" and .metric == "http_req_duration" and .data.tags.status >= "200") | .data.value' myscript-output.json | jq -s max

    For more advanced cases, check out the jq Manual

    Summary export

    If you want to see only the aggregated data, you can export the end-of-test summary to a JSON file. For more details, refer to the handleSummary() topic in the end-of-test summary docs .

    Read more

    • Metrics

    Was this page helpful?

    Suggest an edit in GitHub
    Create a GitHub issue
    Email [email protected]
    Help and support
    Community

    Related resources from Grafana Labs

    Additional helpful documentation, links, and articles:
    webinar icon
    24 Sep
    Performance testing and observability in Grafana Cloud
    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.
    video icon
    60 min
    User-centered observability: load testing, real user monitoring, and synthetics
    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.

    Is this page helpful?

    On this page
    • JSON format
    • Metric
    • Point
    • Processing JSON output
    • Summary export
    • Read more
    Scroll for more
    Sign up for Grafana stack updates
    Note: By signing up, you agree to be emailed related product-level information.

     
    推荐文章
    纯真的木瓜  ·  java实用型-高并发下RestTemplate的正确使用_resttemplate 高并发-CSDN博客
    1 年前
    跑龙套的蚂蚁  ·  while循环中的Thread.sleep()-腾讯云开发者社区-腾讯云
    1 年前
    谦和的手术刀  ·  R语言入门 :基本数据结构 - HuskySir - 博客园
    1 年前
    耍酷的毛豆  ·  How do I check a git config value in a Bash if/else statement? - Stack Overflow
    1 年前
    无邪的钢笔  ·  如何在角11.2.0或更低的角度设置TailwindCSS-腾讯云开发者社区-腾讯云
    2 年前
    Link管理   ·   Sov5搜索   ·   小百科
    link管理 - 链接快照平台