/*
 *  Copyright (c) 2015, Facebook, Inc.
 *  All rights reserved.
 *
 *  This source code is licensed under the BSD-style license found in the
 *  LICENSE file in the root directory of this source tree. An additional grant
 *  of patent rights can be found in the PATENTS file in the same directory.
 *
 */
#pragma once

#include <proxygen/lib/utils/TraceEventObserver.h>

namespace proxygen {
/*
 * A no-op trace event observer
 */
struct NullTraceEventObserver : public TraceEventObserver {
  void traceEventAvailable(TraceEvent) noexcept override {}
};

}

Move sample policy logic to be pre-sending request
Move sample policy logic to be pre-sending request

Summary:
This is a further java memory allocation to reduce unnecessary TraceEvent instance numbers. From the memory profiling result I ran the other day, the most significant memory allocation in java is for trace events, most of which are actually wasted because of the sample policy. This diff move the sample logic to be before sending request. So we
can prevent the trace event instance from being generated at all if it is not sampled.

Test Plan: Still passed

Reviewed By: seanc@fb.com

Subscribers: bmatheny, seanc, ranjeeth, kmdent, shikong, pgriess

FB internal diff: D1946217

Tasks: 6540655

Signature: t1:1946217:1428422016:198c850e6d5a3919202d347e591a4b21813c214d
