#
QCTraceSimulator.GetMetric
Method

## Definition

## Overloads

GetMetric<TOperation,TCaller>(String, OperationFunctor, OperationFunctor) |
Returns the value of a given metric associated with an edge of the call graph. |

GetMetric<TOperation>(String, OperationFunctor) |
Returns the value of a given metric for a top level operation. |

## GetMetric<TOperation,TCaller>(String, OperationFunctor, OperationFunctor)

Returns the value of a given metric associated with an edge of the call graph.

`public double GetMetric<TOperation,TCaller> (string metric, Microsoft.Quantum.Simulation.Core.OperationFunctor functor = Microsoft.Quantum.Simulation.Core.OperationFunctor.Body, Microsoft.Quantum.Simulation.Core.OperationFunctor callerFunctor = Microsoft.Quantum.Simulation.Core.OperationFunctor.Body);`

- TOperation

The C# type corresponding to Q# operation for which the metric is requested.

- TCaller

The C# type corresponding to the caller of the Q# operation for which the metric is requested.

- metric
- System.String

The name of the metric requested for the specified call graph edge.

- functor
- Microsoft.Quantum.Simulation.Core.OperationFunctor

The functor (also called variant) of the operation for which the metric is requested. If not specified, this defaults to the "body" variant.

- callerFunctor
- Microsoft.Quantum.Simulation.Core.OperationFunctor

The functor (also called variant) of the caller of the operation for which the metric is requested. If not specified, this defaults to the "body" variant.

Thrown when a given metric is not well-defined.

### Remarks

For a more detailed discussion of metrics, statistics, call graph edges and operation variants, see the Remarks section of the QCTraceSimulator class documentation.

## GetMetric<TOperation>(String, OperationFunctor)

Returns the value of a given metric for a top level operation.

`public double GetMetric<TOperation> (string metric, Microsoft.Quantum.Simulation.Core.OperationFunctor functor = Microsoft.Quantum.Simulation.Core.OperationFunctor.Body);`

- TOperation

The C# type corresponding to the Q# operation for which the metric is requested.

- metric
- System.String

The name of the metric requested for the top level
operation specified by `TOperation`

- functor
- Microsoft.Quantum.Simulation.Core.OperationFunctor

The functor (also called variant) of the operation for which the metric is requested. If not specified, this defaults to the "body" variant.

Thrown when a given metric is not well-defined.

### Remarks

For a more detailed discussion of metrics, statistics, call graph edges and operation variants, see the Remarks section of the QCTraceSimulator class documentation.