Package com.microsoft.sqlserver.jdbc

## Enum PerformanceActivity

- java.lang.Object
- - java.lang.Enum<PerformanceActivity>
  - - com.microsoft.sqlserver.jdbc.PerformanceActivity

All Implemented Interfaces:
  `Serializable`, `Comparable<PerformanceActivity>`

    public enum PerformanceActivity
    extends Enum<PerformanceActivity>

Enum representing different performance activities tracked by the driver. Connection-Level Activities: - CONNECTION: Total connection establishment time - PRELOGIN: TDS prelogin negotiation time - LOGIN: Authentication/login handshake time - TOKEN_ACQUISITION: Azure AD token acquisition time Statement-Level Activities: - STATEMENT_REQUEST_BUILD: Client-side request building time - STATEMENT_FIRST_SERVER_RESPONSE: Time from packet sent to first response received - STATEMENT_PREPARE: sp_prepare execution time - STATEMENT_PREPEXEC: sp_prepexec (combined prepare+execute) time - STATEMENT_EXECUTE: Statement execution time

### Enum Constant Summary

Enum Constants
`CONNECTION` Total time to establish a connection.
`LOGIN` Time for authentication/login handshake.
`PRELOGIN` Time for TDS prelogin negotiation.
`STATEMENT_EXECUTE` Statement execution time.
`STATEMENT_FIRST_SERVER_RESPONSE` Time from first packet sent to first response received.
`STATEMENT_PREPARE` Time to prepare a statement using sp_prepare.
`STATEMENT_PREPEXEC` Combined prepare+execute time using sp_prepexec.
`STATEMENT_REQUEST_BUILD` Client-side request building time.
`TOKEN_ACQUISITION` Time to acquire Azure AD access tokens.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`String` `activity()`
`String` `toString()`
`static PerformanceActivity` `valueOf​(String name)` Returns the enum constant of this type with the specified name.
`static PerformanceActivity[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### CONNECTION

    public static final PerformanceActivity CONNECTION

Total time to establish a connection. Measured in: connectInternal() Includes: PRELOGIN, LOGIN, and TOKEN_ACQUISITION (if applicable)

#### PRELOGIN

    public static final PerformanceActivity PRELOGIN

Time for TDS prelogin negotiation. Measured in: prelogin() Includes: Encryption negotiation, server capability detection

#### LOGIN

    public static final PerformanceActivity LOGIN

Time for authentication/login handshake. Measured in: login() Includes: TDS login7 packet exchange

#### TOKEN_ACQUISITION

    public static final PerformanceActivity TOKEN_ACQUISITION

Time to acquire Azure AD access tokens. Measured in: onFedAuthInfo() Triggered: Only for Active Directory authentication methods

#### STATEMENT_REQUEST_BUILD

    public static final PerformanceActivity STATEMENT_REQUEST_BUILD

Client-side request building time. Measures: Time from execute*() call until TDS request packet is ready to send. Start: Beginning of executeStatement() (inside retry loop) End: Just before startResponse() sends packet to server Note: Restarts on retry to exclude backoff/sleep time.

#### STATEMENT_FIRST_SERVER_RESPONSE

    public static final PerformanceActivity STATEMENT_FIRST_SERVER_RESPONSE

Time from first packet sent to first response received. Measures: Network latency (both directions) + SQL Server processing time. Start: startResponse() begins - packet sent to server End: First response packet received from server In non-adaptive (full buffering) mode this therefore reflects the time to fully buffer the entire response on the client, not just the first-byte latency. This represents the "server-side" time from client's perspective, including network transit in both directions.

#### STATEMENT_PREPARE

    public static final PerformanceActivity STATEMENT_PREPARE

Time to prepare a statement using sp_prepare. Measured in: doPrep() Triggered: Only when prepareMethod=prepare (NOT the default)

#### STATEMENT_PREPEXEC

    public static final PerformanceActivity STATEMENT_PREPEXEC

Combined prepare+execute time using sp_prepexec. This is the DEFAULT prepare method. SQL Server combines preparation and execution in a single sp_prepexec stored procedure call.

#### STATEMENT_EXECUTE

    public static final PerformanceActivity STATEMENT_EXECUTE

Statement execution time. Measures: Time from sending execution request to response processing complete. For Statement: Full execution time of SQL query.

### Method Detail

#### values

    public static PerformanceActivity[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (PerformanceActivity c : PerformanceActivity.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static PerformanceActivity valueOf​(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null

#### activity

    public String activity()

#### toString

    public String toString()

Overrides:
  `toString` in class `Enum<PerformanceActivity>`