{"templateId":"markdown","versions":[{"version":"9.0","label":"9.0","link":"/classes/whmcs/usagebilling/metrics/metric","default":true,"active":true,"folderId":"9d7dc099"},{"version":"8.13","label":"8.13","link":"/classes/8.13/whmcs/usagebilling/metrics/metric","default":false,"active":false,"folderId":"9d7dc099"}],"sharedDataIds":{"sidebar":"sidebar-classes/@8.13/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"WHMCS\\UsageBilling\\Metrics\\Metric","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"whmcsusagebillingmetricsmetric","__idx":0},"children":["WHMCS\\UsageBilling\\Metrics\\Metric"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Class"]}," · implements ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MetricInterface"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Metric"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"methods","__idx":1},"children":["Methods"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"__construct","__idx":2},"children":["__construct"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function __construct($systemName, $displayName = null, $type = null, UnitInterface $units = null, UsageInterface $usage = null)\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Metric"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parameters"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$systemName"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Canonical name to be used by code and between systems"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$displayName"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Text containing a friendly name to render in UI to users"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string|null"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The metric type, one of MetricInterface::TYPE_*"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UnitInterface|null"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$units"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UsageInterface|null"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["$usage"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"usage","__idx":3},"children":["usage"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function usage()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"withusage","__idx":4},"children":["withUsage"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function withUsage(UsageInterface $usage = null)\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"units","__idx":5},"children":["units"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function units()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"systemname","__idx":6},"children":["systemName"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function systemName()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"displayname","__idx":7},"children":["displayName"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function displayName()\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"type","__idx":8},"children":["type"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"public function type()\n","lang":"php"},"children":[]}]},"headings":[{"value":"WHMCS\\UsageBilling\\Metrics\\Metric","id":"whmcsusagebillingmetricsmetric","depth":1},{"value":"Methods","id":"methods","depth":2},{"value":"__construct","id":"__construct","depth":3},{"value":"usage","id":"usage","depth":3},{"value":"withUsage","id":"withusage","depth":3},{"value":"units","id":"units","depth":3},{"value":"systemName","id":"systemname","depth":3},{"value":"displayName","id":"displayname","depth":3},{"value":"type","id":"type","depth":3}],"frontmatter":{"title":"WHMCS\\UsageBilling\\Metrics\\Metric","seo":{"title":"WHMCS\\UsageBilling\\Metrics\\Metric"}},"lastModified":"2026-08-05T14:37:16.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/classes/whmcs/usagebilling/metrics/metric","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}