This repository was archived by the owner on May 25, 2021. It is now read-only.
forked from census-instrumentation/opencensus-php
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDaemonFunctions.php
More file actions
169 lines (147 loc) · 3.8 KB
/
DaemonFunctions.php
File metadata and controls
169 lines (147 loc) · 3.8 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
/**
*
* @param string $type
* @param string $message
* @return bool
*/
function opencensus_core_send_to_daemonclient(string $type, string $message): bool {
return true;
}
/**
* Usage: https://github.com/nenadstojanovikj/opencensus-php/tree/master/ext#watching-for-functionmethod-invocations
* @param string $functionName
* @param callable $handler
* @return bool Returns success of operation
*/
function opencensus_trace_function(string $functionName, callable $handler): bool {
return true;
}
/**
* Usage: https://github.com/nenadstojanovikj/opencensus-php/tree/master/ext#watching-for-functionmethod-invocations
* @param string $className
* @param string $methodName
* @param callable $handler
* @return bool Returns success of operation
*/
function opencensus_trace_method(string $className, string $methodName, callable $handler): bool {
return true;
}
/**
* Start a trace span. The current trace span (if any) will be set as this span's parent.
*
* @param string $spanName
* @param array $spanOptions
* @return bool Returns true if the span has been created
*/
function opencensus_trace_begin(string $spanName, array $spanOptions): bool {
return true;
}
/**
* Finish the current trace span. The previous trace span (if any) will be set as the current trace span.
*
* @return bool Returns true if the span has been finished
*/
function opencensus_trace_finish(): bool {
return true;
}
/**
* Retrieve the list of collected trace spans
*
* @return Span[]
*/
function opencensus_trace_list(): array {
return [];
}
/**
* Retrieve the count of collected trace spans, currently in memory
*
* @return int
*/
function opencensus_trace_count(): int {
return 0;
}
/**
* Clear the list of collected trace spans
*
* @return bool Returns true if clear was successful
*/
function opencensus_trace_clear(): bool {
return true;
}
/**
* Fetch the current trace context
*
* @return SpanContext
*/
function opencensus_trace_context(): SpanContext {
return new SpanContext();
}
/**
* Set the initial trace context
*
* @param string $traceId The trace id for this request. **Defaults to** a generated value.
* @param string $parentSpanId [optional] The span id of this request's parent. **Defaults to** `null`.
*/
function opencensus_trace_set_context($traceId, $parentSpanId = null): void {
}
/**
* Add an attribute to a span.
*
* @param string $key
* @param string $value
* @param array $options
*
* @type int $spanId The id of the span to which to add the attribute.
* Defaults to the current span.
*/
function opencensus_trace_add_attribute($key, $value, $options = []): void {
}
/**
* Removes a span from the list.
*
* @param string $key
*
*/
function opencensus_trace_remove_span($key): bool {
}
/**
* Add an annotation to a span
* @param string $description
* @param array $options
*
* @type int $spanId The id of the span to which to add the attribute.
* Defaults to the current span.
*/
function opencensus_trace_add_annotation($description, $options = []): void {
}
/**
* Add a link to a span
* @param string $traceId
* @param string $spanId
* @param array $options
*
* @type int $spanId The id of the span to which to add the link.
* Defaults to the current span.
*/
function opencensus_trace_add_link($traceId, $spanId, $options = []): void {
}
/**
* Add a message to a span
* @param string $type
* @param string $id
* @param array $options
*
* @type int $spanId The id of the span to which to add the attribute.
* Defaults to the current span.
*/
function opencensus_trace_add_message_event($type, $id, $options = []): void {
}
/**
* Return the current version of the opencensus_trace extension
*
* @return string
*/
function opencensus_trace_version(): string {
return '1';
}