| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.instrumentation; | 3 library engine.instrumentation; |
| 4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
| 5 /** | 5 /** |
| 6 * The class `Instrumentation` implements support for logging instrumentation in
formation. | 6 * The class `Instrumentation` implements support for logging instrumentation in
formation. |
| 7 * | 7 * |
| 8 * Instrumentation information consists of information about specific operations
. Those operations | 8 * Instrumentation information consists of information about specific operations
. Those operations |
| 9 * can range from user-facing operations, such as saving the changes to a file,
to internal | 9 * can range from user-facing operations, such as saving the changes to a file,
to internal |
| 10 * operations, such as tokenizing source code. The information to be logged is g
athered by | 10 * operations, such as tokenizing source code. The information to be logged is g
athered by |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 * save operation can be calculated. The `log` method tells the builder that all
of the data | 31 * save operation can be calculated. The `log` method tells the builder that all
of the data |
| 32 * has been collected and that the resulting information should be logged. | 32 * has been collected and that the resulting information should be logged. |
| 33 * | 33 * |
| 34 * @coverage dart.engine.utilities | 34 * @coverage dart.engine.utilities |
| 35 */ | 35 */ |
| 36 class Instrumentation { | 36 class Instrumentation { |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * A builder that will silently ignore all data and logging requests. | 39 * A builder that will silently ignore all data and logging requests. |
| 40 */ | 40 */ |
| 41 static InstrumentationBuilder _NULL_INSTRUMENTATION_BUILDER = new Instrumentat
ionBuilder_13(); | 41 static InstrumentationBuilder _NULL_INSTRUMENTATION_BUILDER = new Instrumentat
ionBuilder_14(); |
| 42 | 42 |
| 43 /** | 43 /** |
| 44 * An instrumentation logger that can be used when no other instrumentation lo
gger has been | 44 * An instrumentation logger that can be used when no other instrumentation lo
gger has been |
| 45 * configured. This logger will silently ignore all data and logging requests. | 45 * configured. This logger will silently ignore all data and logging requests. |
| 46 */ | 46 */ |
| 47 static InstrumentationLogger _NULL_LOGGER = new InstrumentationLogger_14(); | 47 static InstrumentationLogger _NULL_LOGGER = new InstrumentationLogger_15(); |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * The current instrumentation logger. | 50 * The current instrumentation logger. |
| 51 */ | 51 */ |
| 52 static InstrumentationLogger _CURRENT_LOGGER = _NULL_LOGGER; | 52 static InstrumentationLogger _CURRENT_LOGGER = _NULL_LOGGER; |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * Create a builder that can collect the data associated with an operation. | 55 * Create a builder that can collect the data associated with an operation. |
| 56 * | 56 * |
| 57 * @param clazz the class performing the operation (not `null`) | 57 * @param clazz the class performing the operation (not `null`) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 /** | 90 /** |
| 91 * Set the logger that should receive instrumentation information to the given
logger. | 91 * Set the logger that should receive instrumentation information to the given
logger. |
| 92 * | 92 * |
| 93 * @param logger the logger that should receive instrumentation information | 93 * @param logger the logger that should receive instrumentation information |
| 94 */ | 94 */ |
| 95 static void set logger(InstrumentationLogger logger2) { | 95 static void set logger(InstrumentationLogger logger2) { |
| 96 _CURRENT_LOGGER = logger2 == null ? _NULL_LOGGER : logger2; | 96 _CURRENT_LOGGER = logger2 == null ? _NULL_LOGGER : logger2; |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 class InstrumentationBuilder_13 implements InstrumentationBuilder { | 99 class InstrumentationBuilder_14 implements InstrumentationBuilder { |
| 100 InstrumentationBuilder data(String name, bool value) => this; | 100 InstrumentationBuilder data(String name, bool value) => this; |
| 101 InstrumentationBuilder data2(String name, int value) => this; | 101 InstrumentationBuilder data2(String name, int value) => this; |
| 102 InstrumentationBuilder data3(String name, String value) => this; | 102 InstrumentationBuilder data3(String name, String value) => this; |
| 103 InstrumentationBuilder data4(String name, List<String> value) => this; | 103 InstrumentationBuilder data4(String name, List<String> value) => this; |
| 104 InstrumentationLevel get instrumentationLevel => InstrumentationLevel.OFF; | 104 InstrumentationLevel get instrumentationLevel => InstrumentationLevel.OFF; |
| 105 void log() { | 105 void log() { |
| 106 } | 106 } |
| 107 void log2(int minTimeToLong) { |
| 108 } |
| 107 InstrumentationBuilder metric(String name, bool value) => this; | 109 InstrumentationBuilder metric(String name, bool value) => this; |
| 108 InstrumentationBuilder metric2(String name, int value) => this; | 110 InstrumentationBuilder metric2(String name, int value) => this; |
| 109 InstrumentationBuilder metric3(String name, String value) => this; | 111 InstrumentationBuilder metric3(String name, String value) => this; |
| 110 InstrumentationBuilder metric4(String name, List<String> value) => this; | 112 InstrumentationBuilder metric4(String name, List<String> value) => this; |
| 111 InstrumentationBuilder record(Exception exception) => this; | 113 InstrumentationBuilder record(Exception exception) => this; |
| 112 } | 114 } |
| 113 class InstrumentationLogger_14 implements InstrumentationLogger { | 115 class InstrumentationLogger_15 implements InstrumentationLogger { |
| 114 InstrumentationBuilder createBuilder(String name) => Instrumentation._NULL_INS
TRUMENTATION_BUILDER; | 116 InstrumentationBuilder createBuilder(String name) => Instrumentation._NULL_INS
TRUMENTATION_BUILDER; |
| 115 } | 117 } |
| 116 /** | 118 /** |
| 117 * The interface `InstrumentationBuilder` defines the behavior of objects used t
o collect data | 119 * The interface `InstrumentationBuilder` defines the behavior of objects used t
o collect data |
| 118 * about an operation that has occurred and record that data through an instrume
ntation logger. | 120 * about an operation that has occurred and record that data through an instrume
ntation logger. |
| 119 * | 121 * |
| 120 * For an example of using objects that implement this interface, see [Instrumen
tation]. | 122 * For an example of using objects that implement this interface, see [Instrumen
tation]. |
| 121 * | 123 * |
| 122 * @coverage dart.engine.utilities | 124 * @coverage dart.engine.utilities |
| 123 */ | 125 */ |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 InstrumentationLevel get instrumentationLevel; | 178 InstrumentationLevel get instrumentationLevel; |
| 177 | 179 |
| 178 /** | 180 /** |
| 179 * Log the data that has been collected. The instrumentation builder should no
t be used after this | 181 * Log the data that has been collected. The instrumentation builder should no
t be used after this |
| 180 * method is invoked. The behavior of any method defined on this interface tha
t is used after this | 182 * method is invoked. The behavior of any method defined on this interface tha
t is used after this |
| 181 * method is invoked is undefined. | 183 * method is invoked is undefined. |
| 182 */ | 184 */ |
| 183 void log(); | 185 void log(); |
| 184 | 186 |
| 185 /** | 187 /** |
| 188 * Log the data that has been collected. The instrumentation builder should no
t be used after this |
| 189 * method is invoked. The behavior of any method defined on this interface tha
t is used after this |
| 190 * method is invoked is undefined. |
| 191 * |
| 192 * @param minTimeToLog if the total elapsed time is less than this, do not rec
ord |
| 193 */ |
| 194 void log2(int minTimeToLog); |
| 195 |
| 196 /** |
| 186 * Append the given metric to the data being collected by this builder. The in
formation is | 197 * Append the given metric to the data being collected by this builder. The in
formation is |
| 187 * declared to contain only metrics data (data that is not user identifiable a
nd does not contain | 198 * declared to contain only metrics data (data that is not user identifiable a
nd does not contain |
| 188 * user intellectual property). | 199 * user intellectual property). |
| 189 * | 200 * |
| 190 * @param name the name used to identify the data | 201 * @param name the name used to identify the data |
| 191 * @param value the value of the data to be collected | 202 * @param value the value of the data to be collected |
| 192 * @return this builder | 203 * @return this builder |
| 193 */ | 204 */ |
| 194 InstrumentationBuilder metric(String name, bool value); | 205 InstrumentationBuilder metric(String name, bool value); |
| 195 | 206 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 */ | 248 */ |
| 238 InstrumentationBuilder record(Exception exception); | 249 InstrumentationBuilder record(Exception exception); |
| 239 } | 250 } |
| 240 /** | 251 /** |
| 241 * The instrumentation recording level representing (1) recording [EVERYTHING] r
ecording of | 252 * The instrumentation recording level representing (1) recording [EVERYTHING] r
ecording of |
| 242 * all instrumentation data, (2) recording only [METRICS] information, or (3) re
cording | 253 * all instrumentation data, (2) recording only [METRICS] information, or (3) re
cording |
| 243 * turned [OFF] in which case nothing is recorded. | 254 * turned [OFF] in which case nothing is recorded. |
| 244 * | 255 * |
| 245 * @coverage dart.engine.utilities | 256 * @coverage dart.engine.utilities |
| 246 */ | 257 */ |
| 247 class InstrumentationLevel implements Comparable<InstrumentationLevel> { | 258 class InstrumentationLevel implements Enum<InstrumentationLevel> { |
| 248 | 259 |
| 249 /** Recording all instrumented information */ | 260 /** Recording all instrumented information */ |
| 250 static final InstrumentationLevel EVERYTHING = new InstrumentationLevel('EVERY
THING', 0); | 261 static final InstrumentationLevel EVERYTHING = new InstrumentationLevel('EVERY
THING', 0); |
| 251 | 262 |
| 252 /** Recording only metrics */ | 263 /** Recording only metrics */ |
| 253 static final InstrumentationLevel METRICS = new InstrumentationLevel('METRICS'
, 1); | 264 static final InstrumentationLevel METRICS = new InstrumentationLevel('METRICS'
, 1); |
| 254 | 265 |
| 255 /** Nothing recorded */ | 266 /** Nothing recorded */ |
| 256 static final InstrumentationLevel OFF = new InstrumentationLevel('OFF', 2); | 267 static final InstrumentationLevel OFF = new InstrumentationLevel('OFF', 2); |
| 257 static final List<InstrumentationLevel> values = [EVERYTHING, METRICS, OFF]; | 268 static final List<InstrumentationLevel> values = [EVERYTHING, METRICS, OFF]; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 301 |
| 291 /** | 302 /** |
| 292 * Create a builder that can collect the data associated with an operation ide
ntified by the given | 303 * Create a builder that can collect the data associated with an operation ide
ntified by the given |
| 293 * name. | 304 * name. |
| 294 * | 305 * |
| 295 * @param name the name used to uniquely identify the operation | 306 * @param name the name used to uniquely identify the operation |
| 296 * @return the builder that was created | 307 * @return the builder that was created |
| 297 */ | 308 */ |
| 298 InstrumentationBuilder createBuilder(String name); | 309 InstrumentationBuilder createBuilder(String name); |
| 299 } | 310 } |
| OLD | NEW |