|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
17 | | -/** |
18 | | - * @typedef {object} DebugAgentConfig |
19 | | - */ |
20 | | -export interface DebugAgentConfig { |
21 | | - /** |
22 | | - * @property {?string} |
23 | | - * @memberof DebugAgentConfig |
24 | | - * @default |
25 | | - */ |
| 17 | +import {AuthenticationConfig} from '../types/common-types'; |
| 18 | + |
| 19 | +export interface DebugAgentConfig extends AuthenticationConfig { |
26 | 20 | workingDirectory: string|null; |
27 | 21 |
|
28 | 22 | /** |
29 | | - * @property {?string} A user specified way of identifying the service |
30 | | - * that the debug agent is monitoring. |
31 | | - * @memberof DebugAgentConfig |
32 | | - * @default |
| 23 | + * A user specified way of identifying the service |
33 | 24 | */ |
34 | 25 | description: string|null; |
35 | 26 |
|
36 | 27 | /** |
37 | | - * @property {boolean} Whether or not it is permitted to evaluate expressions. |
| 28 | + * Whether or not it is permitted to evaluate expressions. |
38 | 29 | * Locals and arguments are not displayed and watch expressions and |
39 | 30 | * conditions are dissallowed when this is `false`. |
40 | | - * @memberof DebugAgentConfig |
41 | | - * @default |
42 | 31 | */ |
43 | 32 | allowExpressions: boolean; |
44 | 33 |
|
45 | 34 | /** |
46 | | - * @property {object} Identifies the context of the running service - |
| 35 | + * Identifies the context of the running service - |
47 | 36 | * [ServiceContext](https://cloud.google.com/error-reporting/reference/rest/v1beta1/ServiceContext?authuser=2). |
48 | 37 | * This information is utilized in the UI to identify all the running |
49 | 38 | * instances of your service. This is discovered automatically when your |
50 | 39 | * application is running on Google Cloud Platform. You may optionally |
51 | 40 | * choose to provide this information yourself to identify your service |
52 | 41 | * differently from the default mechanism. |
53 | | - * @memberof DebugAgentConfig |
54 | | - * @default |
55 | 42 | */ |
56 | 43 | serviceContext: { |
57 | 44 | /** |
58 | | - * @property {?string} the service name |
59 | | - * @default |
| 45 | + * The service name. |
60 | 46 | */ |
61 | 47 | service: string | null; |
62 | 48 |
|
63 | 49 | /** |
64 | | - * @property {?string} the service version |
65 | | - * @default |
| 50 | + * The service version. |
66 | 51 | */ |
67 | 52 | version: string | null; |
68 | 53 |
|
69 | 54 | /** |
70 | | - * @property {?string} a unique deployment identifier. This is used |
71 | | - * internally only. |
72 | | - * @private |
| 55 | + * A unique deployment identifier. This is used internally only. |
73 | 56 | */ |
74 | 57 | minorVersion_: string | null; |
75 | 58 | }; |
76 | 59 |
|
77 | 60 | /** |
78 | | - * @property {?string} The path within your repository to the directory |
| 61 | + * The path within your repository to the directory |
79 | 62 | * containing the package.json for your deployed application. This should |
80 | 63 | * be provided if your deployed application appears as a subdirectory of |
81 | 64 | * your repository. Usually this is unnecessary, but may be useful in |
82 | 65 | * cases where the debug agent is unable to resolve breakpoint locations |
83 | 66 | * unambiguously. |
84 | | - * @memberof DebugAgentConfig |
85 | | - * @default |
86 | 67 | */ |
87 | 68 | appPathRelativeToRepository: string|null; |
88 | 69 |
|
89 | 70 | /** |
90 | | - * @property {number} agent log level 0-disabled, 1-error, 2-warn, 3-info, |
91 | | - * 4-debug |
92 | | - * @memberof DebugAgentConfig |
93 | | - * @default |
| 71 | + * agent log level 0-disabled, 1-error, 2-warn, 3-info, 4-debug |
94 | 72 | */ |
95 | 73 | logLevel: number; |
96 | 74 |
|
97 | 75 | /** |
98 | | - * @property {number} How frequently should the list of breakpoints be |
99 | | - * refreshed from the cloud debug server. |
100 | | - * @memberof DebugAgentConfig |
101 | | - * @default |
| 76 | + * How frequently should the list of breakpoints be refreshed from the cloud |
| 77 | + * debug server. |
102 | 78 | */ |
103 | 79 | breakpointUpdateIntervalSec: number; |
104 | 80 |
|
105 | 81 | /** |
106 | | - * @property {number} breakpoints and logpoints older than this number of |
107 | | - * seconds will be expired on the server. |
108 | | - * @memberof DebugAgentConfig |
109 | | - * @default |
| 82 | + * breakpoints and logpoints older than this number of seconds will be expired |
| 83 | + * on the server. |
110 | 84 | */ |
111 | 85 | breakpointExpirationSec: number; |
112 | 86 |
|
113 | 87 | /** |
114 | | - * @property {object} configuration options on what is captured on a |
115 | | - * snapshot. |
116 | | - * @memberof DebugAgentConfig |
| 88 | + * configuration options on what is captured on a snapshot. |
117 | 89 | */ |
118 | 90 | capture: { |
119 | 91 | /** |
120 | | - * @property {boolean} Whether to include details about stack frames |
121 | | - * belonging to node-core. |
122 | | - * @default |
| 92 | + * Whether to include details about stack frames belonging to node-core. |
123 | 93 | */ |
124 | 94 | includeNodeModules: boolean; |
125 | 95 |
|
126 | | - |
127 | 96 | /** |
128 | | - * @property {number} Maximum number of stack frames to capture data for. |
129 | | - * The limit is aimed to reduce overall capture time. |
130 | | - * @default |
| 97 | + * Maximum number of stack frames to capture data for. The limit is aimed to |
| 98 | + * reduce overall capture time. |
131 | 99 | */ |
132 | 100 | maxFrames: number; |
133 | 101 |
|
134 | 102 | /** |
135 | | - * @property {number} We collect locals and arguments on a few top frames. |
136 | | - * For the rest only collect the source location |
137 | | - * @default |
| 103 | + * We collect locals and arguments on a few top frames. For the rest only |
| 104 | + * collect the source location |
138 | 105 | */ |
139 | 106 | maxExpandFrames: number; |
140 | 107 |
|
141 | 108 | /** |
142 | | - * @property {number} To reduce the overall capture time, limit the number |
143 | | - * of properties gathered on large objects. A value of 0 disables the |
144 | | - * limit. |
145 | | - * @default |
| 109 | + * To reduce the overall capture time, limit the number of properties |
| 110 | + * gathered on large objects. A value of 0 disables the limit. |
146 | 111 | */ |
147 | 112 | maxProperties: number; |
148 | 113 |
|
149 | 114 | /** |
150 | | - * @property {number} Total 'size' of data to gather. This is NOT the |
151 | | - * number of bytes of data that are sent over the wire, but instead a |
152 | | - * very very coarse approximation based on the length of names and |
153 | | - * values of the properties. This should be somewhat proportional to the |
154 | | - * amount of processing needed to capture the data and subsequently the |
155 | | - * network traffic. A value of 0 disables the limit. |
156 | | - * @default |
| 115 | + * Total 'size' of data to gather. This is NOT the number of bytes of data |
| 116 | + * that are sent over the wire, but instead a very very coarse approximation |
| 117 | + * based on the length of names and values of the properties. This should be |
| 118 | + * somewhat proportional to the amount of processing needed to capture the |
| 119 | + * data and subsequently the network traffic. A value of 0 disables the |
| 120 | + * limit. |
157 | 121 | */ |
158 | 122 | maxDataSize: number; |
159 | 123 |
|
160 | 124 | /** |
161 | | - * @property {number} To limit the size of the buffer, we truncate long |
162 | | - * strings. A value of 0 disables truncation. |
163 | | - * @default |
| 125 | + * To limit the size of the buffer, we truncate long strings. A value of 0 |
| 126 | + * disables truncation. |
164 | 127 | */ |
165 | 128 | maxStringLength: number; |
166 | 129 | }; |
167 | 130 |
|
168 | 131 | /** |
169 | | - * @property {object} options affecting log points. |
170 | | - * @memberof DebugAgentConfig |
| 132 | + * options affecting log points. |
171 | 133 | */ |
172 | 134 | log: { |
173 | 135 | /** |
174 | | - * @property {number} The maximum number of logs to record per second per |
175 | | - * logpoint. |
176 | | - * @memberof DebugAgentConfig |
177 | | - * @default |
| 136 | + * The maximum number of logs to record per second per logpoint. |
178 | 137 | */ |
179 | 138 | maxLogsPerSecond: number; |
180 | 139 |
|
181 | 140 | /** |
182 | | - * @property {number} Number of seconds to wait after the |
183 | | - * `maxLogsPerSecond` rate is hit before logging resumes per logpoint. |
184 | | - * @default |
| 141 | + * Number of seconds to wait after the `maxLogsPerSecond` rate is hit before |
| 142 | + * logging resumes per logpoint. |
185 | 143 | */ |
186 | 144 | logDelaySeconds: number; |
187 | 145 | }; |
188 | 146 |
|
189 | 147 | /** |
190 | | - * @property {object} These configuration options are for internal |
191 | | - * experimentation only. |
192 | | - * @memberof DebugAgentConfig |
193 | | - * @private |
| 148 | + * These configuration options are for internal experimentation only. |
194 | 149 | */ |
195 | 150 | internal: { |
196 | | - // TODO: Determine if clang-format can be configured to place |
197 | | - // a newline between these two statements. |
198 | 151 | registerDelayOnFetcherErrorSec: number; maxRegistrationRetryDelay: number; |
199 | 152 | }; |
200 | 153 |
|
201 | 154 | /** |
202 | | - * @property {boolean} Used by tests to force loading of a new agent if one |
203 | | - * exists already |
204 | | - * @memberof DebugAgentConfig |
205 | | - * @private |
| 155 | + * Used by tests to force loading of a new agent if one exists already |
206 | 156 | */ |
207 | 157 | forceNewAgent_: boolean; |
208 | 158 |
|
209 | 159 | /** |
210 | | - * @property {boolean} Uses by tests to cause the start() function to return |
211 | | - * the debuglet. |
212 | | - * @memberof DebugAgentConfig |
213 | | - * @private |
| 160 | + * Uses by tests to cause the start() function to return the debuglet. |
214 | 161 | */ |
215 | 162 | testMode_: boolean; |
216 | 163 | } |
217 | 164 |
|
| 165 | +export interface StackdriverConfig extends AuthenticationConfig { |
| 166 | + debug?: DebugAgentConfig; |
| 167 | +} |
| 168 | + |
218 | 169 | const defaultConfig: DebugAgentConfig = { |
219 | 170 | // FIXME(ofrobots): presently this is dependent what cwd() is at the time this |
220 | 171 | // file is first required. We should make the default config static. |
|
0 commit comments