Send metric data to datadog

The given values will be used to create a new Metric
object, encapsulated it into a Series and sent.

@param string $name
@param array  $points
@param array  $options

@return Client
978475
public function metric($name, array $points, array $options = array()) {
        return $this->sendMetric(
            Factory::buildMetric($name, $points, $options)
        );
    }
759006
public function create($name, $options = array()) {
        $options = new Values($options);

        $data = Values::of(array('Name' => $name, 'CodeLength' => $options['codeLength'], ));

        $payload = $this->version->create(
            'POST',
            $this->uri,
            array(),
            $data
        );

        return new ServiceInstance($this->version, $payload);
    }
287374
protected function sendRequest($url, $method = 'get', array $options = [])
    {
        return $this->send(
          new Request($method, $url),
          $this->client,
          $options
        );
    }
617276
public function with($name, array $options = [])
    {
        /*
         * The current implementation should work with the following workflow:
         *
         *     $formMapper
         *        ->with('group1')
         *            ->add('username')
         *            ->add('password')
         *        ->end()
         *        ->with('tab1', ['tab' => true])
         *            ->with('group1')
         *                ->add('username')
         *                ->add('password')
         *            ->end()
         *            ->with('group2', ['collapsed' => true])
         *                ->add('enabled')
         *                ->add('createdAt')
         *            ->end()
         *        ->end();
         *
         */
        $defaultOptions = [
            'collapsed' => false,
            'class' => false,
            'description' => false,
            'label' => $name, // NEXT_MAJOR: Remove this line and uncomment the next one
//            'label' => $this->admin->getLabelTranslatorStrategy()->getLabel($name, $this->getName(), 'group'),
            'translation_domain' => null,
            'name' => $name,
            'box_class' => 'box box-primary',
        ];

        // NEXT_MAJOR: remove this code
        if ($this->admin instanceof AbstractAdmin && $pool = $this->admin->getConfigurationPool()) {
            if ($pool->getContainer()->getParameter('sonata.admin.configuration.translate_group_label')) {
                $defaultOptions['label'] = $this->admin->getLabelTranslatorStrategy()->getLabel($name, $this->getName(), 'group');
            }
        }

        $code = $name;

        // Open
        if (\array_key_exists('tab', $options) && $options['tab']) {
            $tabs = $this->getTabs();

            if ($this->currentTab) {
                if (isset($tabs[$this->currentTab]['auto_created']) && true === $tabs[$this->currentTab]['auto_created']) {
                    throw new \RuntimeException('New tab was added automatically when you have added field or group. You should close current tab before adding new one OR add tabs before adding groups and fields.');
                }

                throw new \RuntimeException(sprintf('You should close previous tab "%s" with end() before adding new tab "%s".', $this->currentTab, $name));
            } elseif ($this->currentGroup) {
                throw new \RuntimeException(sprintf('You should open tab before adding new group "%s".', $name));
            }

            if (!isset($tabs[$name])) {
                $tabs[$name] = [];
            }

            $tabs[$code] = array_merge($defaultOptions, [
                'auto_created' => false,
                'groups' => [],
            ], $tabs[$code], $options);

            $this->currentTab = $code;
        } else {
            if ($this->currentGroup) {
                throw new \RuntimeException(sprintf('You should close previous group "%s" with end() before adding new tab "%s".', $this->currentGroup, $name));
            }

            if (!$this->currentTab) {
                // no tab define
                $this->with('default', [
                    'tab' => true,
                    'auto_created' => true,
                    'translation_domain' => $options['translation_domain'] ?? null,
                ]); // add new tab automatically
            }

            // if no tab is selected, we go the the main one named '_' ..
            if ('default' !== $this->currentTab) {
                $code = $this->currentTab.'.'.$name; // groups with the same name can be on different tabs, so we prefix them in order to make unique group name
            }

            $groups = $this->getGroups();
            if (!isset($groups[$code])) {
                $groups[$code] = [];
            }

            $groups[$code] = array_merge($defaultOptions, [
                'fields' => [],
            ], $groups[$code], $options);

            $this->currentGroup = $code;
            $this->setGroups($groups);
            $tabs = $this->getTabs();
        }

        if ($this->currentGroup && isset($tabs[$this->currentTab]) && !\in_array($this->currentGroup, $tabs[$this->currentTab]['groups'], true)) {
            $tabs[$this->currentTab]['groups'][] = $this->currentGroup;
        }

        $this->setTabs($tabs);

        return $this;
    }
1109730
public function set($name, $value, array $options = [])
    {
        $options = $this->options($options);
        $value   = parent::set($name, $value, $options);

        return setcookie(
            $this->normalize($name),
            $value,
            $options[self::OPTION_EXPIRE],
            $options[self::OPTION_PATH],
            $options[self::OPTION_DOMAIN],
            false,
            $options[self::OPTION_HTTP_ONLY]
        );
    }
1356102
public static function get($name, $options = [])
    {
        $default = isset($options["default"]) ? $options["default"] : null;

        return isset($_REQUEST[$name]) ? $_REQUEST[$name]: $default;
    }
425214
public function post($endpoint, $data, $options = [])
    {
        if (!is_array($data)) {
            $options['body'] = $data;
        } else {
            $options['form_params'] = $data;
        }

        return $this->request('post', $endpoint, $options);
    }
1243848
public function run($pointName, array $data = [], array $headers = [])
    {
        $this->endpoint = $this->api->getEndpoints()->findOrFail($pointName);

        $client = new Client($this->api->getHandler());
        $method = $this->endpoint->getMethod();
        $uri = $this->endpoint->getUri($data);
        $body = $this->makeBody($headers, $data);
        $response = $client->request($method, $uri, $body);

        return new Response($response, $this->endpoint->getTransformer());
    }
671450
public function createUrlListForm(
        URLListData $data = null,
        ?string $name = null,
        array $options = []
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(SearchData::class);

        return $this->formFactory->createNamed($name, URLListType::class, $data, $options);
    }
269040
protected function setOption(Array $options, $name, $method)
    {
        if (isset($options[$name])) {
            $this->$method($options[$name]);
        }
    }
941747
public function withImage(
        $name = null,
        $width = null,
        $height = null,
        $options = null)
    {
        $this->withRenamedImage($name, $name, $width, $height, $options);

        return $this;
    }
112110
public function data($name, $options = null, $auth = null)
	{
		if ($this->options && !$options)
		{
			$options = $this->options;
		}

		if ($this->auth && !$auth)
		{
			$auth = $this->auth;
		}

		switch (strtolower($name))
		{
			case 'plus':
				return new Data\Plus($options, $auth);

			case 'picasa':
				return new Data\Picasa($options, $auth);

			case 'adsense':
				return new Data\Adsense($options, $auth);

			case 'calendar':
				return new Data\Calendar($options, $auth);

			default:
				return null;
		}
	}
25684
public function createTransformation($name, $definition, $options=array())
    {
        return $this->getApi()->create_transformation($name, $definition, $options);
    }
980108
public function plugin($name, array $options = [])
    {
        $plugins = $this->getPluginManager();
        return $plugins->get($name, $options);
    }
311540
public function make($name, $options)
    {
        if (!$name) {
            return null;
        }

        if (strpos($name, __NAMESPACE__) === false) {
            $name = __NAMESPACE__ . '\\' . $name;
        }

        if (isset($this->operationMap[$name])) {
            return $this->operationMap[$name];
        }

        if (!class_exists($name, true)) {
            return null;
        }

        $this->operationMap[$name] = new $name($options);

        return $this->operationMap[$name];
    }
549789
public function sendRequest($request, $options = [])
    {
        $client = $this->client;
        $response = $client->send($request, $options);

        return $response;
    }
590697
public function get($name, $options = array(), $usePeeringServiceManagers = true)
    {
        if (empty($options['name'])) {
            $options['name'] = $name;
        }

        return parent::get($name, $options, $usePeeringServiceManagers);
    }