Пример #1
0
        /// <summary>
        /// Creates a rule to control sampling behavior for instrumented applications. Services
        /// retrieve rules with <a>GetSamplingRules</a>, and evaluate each rule in ascending order
        /// of <i>priority</i> for each request. If a rule matches, the service records a trace,
        /// borrowing it from the reservoir size. After 10 seconds, the service reports back to
        /// X-Ray with <a>GetSamplingTargets</a> to get updated versions of each in-use rule.
        /// The updated rule contains a trace quota that the service can use instead of borrowing
        /// from the reservoir.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateSamplingRule service method.</param>
        ///
        /// <returns>The response from the CreateSamplingRule service method, as returned by XRay.</returns>
        /// <exception cref="Amazon.XRay.Model.InvalidRequestException">
        /// The request is missing required parameters or has invalid parameters.
        /// </exception>
        /// <exception cref="Amazon.XRay.Model.RuleLimitExceededException">
        /// You have reached the maximum number of sampling rules.
        /// </exception>
        /// <exception cref="Amazon.XRay.Model.ThrottledException">
        /// The request exceeds the maximum number of requests per second.
        /// </exception>
        public virtual CreateSamplingRuleResponse CreateSamplingRule(CreateSamplingRuleRequest request)
        {
            var marshaller   = CreateSamplingRuleRequestMarshaller.Instance;
            var unmarshaller = CreateSamplingRuleResponseUnmarshaller.Instance;

            return(Invoke <CreateSamplingRuleRequest, CreateSamplingRuleResponse>(request, marshaller, unmarshaller));
        }
Пример #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateSamplingRule operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateSamplingRule operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public virtual Task <CreateSamplingRuleResponse> CreateSamplingRuleAsync(CreateSamplingRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = CreateSamplingRuleRequestMarshaller.Instance;
            var unmarshaller = CreateSamplingRuleResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateSamplingRuleRequest, CreateSamplingRuleResponse>(request, marshaller,
                                                                                       unmarshaller, cancellationToken));
        }
Пример #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateSamplingRule operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateSamplingRule operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public virtual Task <CreateSamplingRuleResponse> CreateSamplingRuleAsync(CreateSamplingRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateSamplingRuleRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateSamplingRuleResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateSamplingRuleResponse>(request, options, cancellationToken));
        }
Пример #4
0
        internal virtual CreateSamplingRuleResponse CreateSamplingRule(CreateSamplingRuleRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateSamplingRuleRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateSamplingRuleResponseUnmarshaller.Instance;

            return(Invoke <CreateSamplingRuleResponse>(request, options));
        }