forked from chregu/hhvm-newrelic-ext
-
Notifications
You must be signed in to change notification settings - Fork 1
/
newrelic_profiler.h
64 lines (47 loc) · 1.68 KB
/
newrelic_profiler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef incl_HPHP_NEWRELIC_PROFILER_H_
#define incl_HPHP_NEWRELIC_PROFILER_H_
#include "hphp/runtime/ext/hotprofiler/ext_hotprofiler.h"
#include "hphp/runtime/base/php-globals.h"
#include "hphp/runtime/server/server-stats.h"
#include "newrelic_transaction.h"
#include "newrelic_collector_client.h"
#include "newrelic_common.h"
namespace HPHP {
///////////////////////////////////////////////////////////////////////////////
const StaticString
s__SERVER("_SERVER"),
s__REQUEST_URI("REQUEST_URI"),
s__SCRIPT_NAME("SCRIPT_NAME"),
s__QUERY_STRING("QUERY_STRING"),
s__EMPTY(""),
s__HTTP_HOST("HTTP_HOST"),
s__HTTPS("HTTPS"),
s__PROTO_HTTP("http://"),
s__PROTO_HTTPS("https://"),
s__NEWRELIC("newrelic");
class NewRelicProfiler : public Profiler {
public:
// NEWOBJ existsonly until HHVM 3.4
#ifdef NEWOBJ
explicit NewRelicProfiler(int64_t mdepth) : max_depth(mdepth) {}
#else
explicit NewRelicProfiler(int64_t mdepth) : Profiler(true), max_depth(mdepth) {}
#endif
virtual void beginFrameEx(const char *symbol);
virtual void endFrameEx(const TypedValue *retval, const char *given_symbol);
virtual Frame *allocateFrame() override {
return new NewRelicProfilerFrame();
}
//virtual Frame *allocateFrame() override;
private:
class NewRelicProfilerFrame : public Frame {
public:
virtual ~NewRelicProfilerFrame() {
}
int m_nr_depth;
int64_t m_nr_segement_code;
};
int max_depth;
};
}
#endif // incl_HPHP_NEWRELIC_PROFILER_H_