crashpad::Metrics Class Reference

Container class to hold shared UMA metrics integration points. More...

`#include "util/misc/metrics.h"`

## Public Types

enum | PendingReportReason : int32_t
| Values for CrashReportPending(). More...
enum | CrashSkippedReason : int32_t
| Values for CrashUploadSkipped(). More...
enum | CaptureResult : int32_t
| The result of capturing an exception. More...
enum | LifetimeMilestone : int32_t
| An important event in a handler process’ lifetime. More...

## Static Public Member Functions

static void | CrashReportPending (PendingReportReason reason)
| Reports when a crash upload has entered the pending state.
static void | CrashReportSize (FileOffset size)
| Reports the size of a crash report file in bytes. Should be called when a new report is written to disk.
static void | CrashUploadAttempted (bool successful)
| Reports on a crash upload attempt, and if it succeeded.
static void | CrashUploadSkipped (CrashSkippedReason reason)
| Reports when a report is moved to the completed state in the database, without the report being uploadad.
static void | ExceptionCaptureResult (CaptureResult result)
| Reports on the outcome of capturing a report in the exception handler. Should be called on all capture completion paths.
static void | ExceptionCode (uint32_t exception_code)
| The exception code for an exception was retrieved. More...
static void | ExceptionEncountered ()
| The exception handler server started capturing an exception.
static void | HandlerLifetimeMilestone (LifetimeMilestone milestone)
| Records a handler start/exit/crash event.
static void | HandlerCrashed (uint32_t exception_code)
| The handler process crashed with the given exception code. More...

## Detailed Description

Container class to hold shared UMA metrics integration points.

Each static function in this class will call a `UMA_*` from `base/metrics/histogram_macros.h`. When building Crashpad standalone, (against mini_chromium), these macros do nothing. When built against Chromium's base, they allow integration with its metrics system.

## Member Enumeration Documentation

## CaptureResult

enum crashpad::Metrics::CaptureResult : int32_t

strong

The result of capturing an exception.

Note
  These are used as metrics enumeration values, so new values should always be added at the end, before CaptureResult::kMaxValue.

Enumerator
kSuccess | The exception capture succeeded normally.
kUnexpectedExceptionBehavior | Unexpected exception behavior. This value is only used on macOS.
kFailedDueToSuspendSelf | Failed due to attempt to suspend self. This value is only used on macOS.
kSnapshotFailed | The process snapshot could not be captured.
kExceptionInitializationFailed | The exception could not be initialized.
kPrepareNewCrashReportFailed | The attempt to prepare a new crash report in the crash database failed.
kMinidumpWriteFailed | Writing the minidump to disk failed.
kFinishedWritingCrashReportFailed | There was a database error in attempt to complete the report.
kDirectPtraceFailed | An attempt to directly `ptrace` the target failed. This value is only used on Linux/Android.
kBrokeredPtraceFailed | An attempt to `ptrace` via a PtraceBroker failed. This value is only used on Linux/Android.
kSanitizationInitializationFailed | Sanitization was requested but could not be initialized.
kSkippedDueToSanitization | Sanitization caused this crash dump to be skipped.
kMaxValue | The number of values in this enumeration; not a valid value.

## CrashSkippedReason

enum crashpad::Metrics::CrashSkippedReason : int32_t

strong

Values for CrashUploadSkipped().

Note
  These are used as metrics enumeration values, so new values should always be added at the end, before CrashSkippedReason::kMaxValue.

Enumerator
kUploadsDisabled | Crash uploading is disabled.
kUploadThrottled | There was another upload too recently, so this one was throttled.
kUnexpectedTime | The report had an unexpected timestamp.
kDatabaseError | The database reported an error, likely due to a filesystem problem.
kUploadFailed | The upload of the crash failed during communication with the server.
kPrepareForUploadFailed | There was an error between accessing the report from the database and uploading it to the crash server.
kMaxValue | The number of values in this enumeration; not a valid value.

## LifetimeMilestone

enum crashpad::Metrics::LifetimeMilestone : int32_t

strong

An important event in a handler process’ lifetime.

Note
  These are used as metrics enumeration values, so new values should always be added at the end, before LifetimeMilestone::kMaxValue.

Enumerator
kStarted | The handler process started.
kExitedNormally | The handler process exited normally and cleanly.
kExitedEarly | The handler process exited early, but was successful in performing some non-default action on user request.
kFailed | The handler process exited with a failure code.
kTerminated | The handler process was forcibly terminated.
kCrashed | The handler process crashed.
kMaxValue | The number of values in this enumeration; not a valid value.

## PendingReportReason

enum crashpad::Metrics::PendingReportReason : int32_t

strong

Values for CrashReportPending().

Note
  These are used as metrics enumeration values, so new values should always be added at the end, before PendingReportReason::kMaxValue.

Enumerator
kNewlyCreated | A report was newly created and is ready for upload.
kUserInitiated | The user manually requested the report be uploaded.
kMaxValue | The number of values in this enumeration; not a valid value.

## Member Function Documentation

## ExceptionCode()

void crashpad::Metrics::ExceptionCode | ( | uint32_t | exception_code | ) |

static

The exception code for an exception was retrieved.

These values are OS-specific, and correspond to MINIDUMP_EXCEPTION::ExceptionCode.

## HandlerCrashed()

void crashpad::Metrics::HandlerCrashed | ( | uint32_t | exception_code | ) |

static

The handler process crashed with the given exception code.

This is currently only reported on Windows.

The documentation for this class was generated from the following files:

- util/misc/metrics.h
- util/misc/metrics.cc