perfstat

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

Instance defines an instance of the operation to be tracked.

func NewInstance

func NewInstance(des string) *Instance

NewInstance sets up and returns a new Instance.

func (*Instance) Elapsed

func (it *Instance) Elapsed() int64

Elapsed returns the elapsed time for the instance in usec.

func (*Instance) End

func (it *Instance) End()

End ends the timer for the Instance and commit it to the associated PerfStat.

func (*Instance) Setup

func (it *Instance) Setup(ps *PerfStat, des string)

Setup sets up instance with the given parameters.

func (*Instance) Show

func (it *Instance) Show(limit uint64)

Show displays the elapsed time of the instance.

func (*Instance) Start

func (it *Instance) Start()

Start restarts the timer for the Instance.

func (*Instance) WebShow

func (it *Instance) WebShow(limit uint64) string

WebShow returns the elapsed time of the instance in string format.

type PerfStat

type PerfStat struct {
	// contains filtered or unexported fields
}

PerfStat defines the information to track the performance of an operation.

func New

func New(des string) *PerfStat

New sets up and returns a new PerfStat. The caller needs to pass in a string to describe the performance stat for an opeartion.

func (*PerfStat) Count

func (ps *PerfStat) Count() uint64

Count returns the total ops of the PerfStat.

func (*PerfStat) Elapsed

func (ps *PerfStat) Elapsed() uint64

Elapsed returns the total elapsed time of the PerfStat

func (*PerfStat) NewInstance

func (ps *PerfStat) NewInstance(des string) *Instance

NewInstance creates and returns a new tracking instance for the specified PerfStat.

func (*PerfStat) String

func (ps *PerfStat) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL