Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PluginMetricsCreator

Index

Constructors

Properties

NODE_BASED_REGEX: RegExp = ...
_extensionIDAnalytics: MetricsMap
pluginMetrics: PluginMetrics

Accessors

Methods

  • Create an error metric for requestData.pluginID by attempting to extract the erroring language server method from the requestData.errorContentsOrMethod. If it cannot extract the error language server method from requestData.errorContentsOrMethod then it will not create a metric.

    Parameters

    Returns Promise<void>

  • createMetric(requestData: DataFromRequest, isRequestSuccessful: boolean): Promise<void>
  • decreaseExtensionRequests(pluginID: string, method: string): void
  • Decreases the total requests and the successful responses for pluginID with method by 1.

    This is needed because an error and a successful language server request aren't currently associated together because of https://github.com/microsoft/vscode-languageserver-node/issues/517. That means that every language server request that resolves counts as a successful language server request. Therefore, we need to decrease the extension requests for pluginID when we know there is an error. Otherwise, for every language server request that errors we would count it as both a success and a failure.

    Parameters

    • pluginID: string

      The id of the plugin that should have the decreased requests

    • method: string

    Returns void

  • extractMethodFromValue(errorContents: undefined | string): undefined | string
  • Attempts to extract the method name from the current errorContents using the vscode-languageclient matching regex.

    If it cannot find a match in the errorContents it returns undefined

    Parameters

    • errorContents: undefined | string

      The contents of the current error or undefined

    Returns undefined | string

  • setPluginMetrics(): void