| 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 | 3 |
| 4 library engine.instrumentation; | 4 library engine.instrumentation; |
| 5 | 5 |
| 6 import 'java_core.dart'; | 6 import 'java_core.dart'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * The class {@code Instrumentation} implements support for logging instrumentat
ion information. | 9 * The class {@code Instrumentation} implements support for logging instrumentat
ion information. |
| 10 * <p> | 10 * <p> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * following: | 21 * following: |
| 22 * <pre> | 22 * <pre> |
| 23 * InstrumentationBuilder instrumentation = Instrumentation.builder(this.getClas
s()); | 23 * InstrumentationBuilder instrumentation = Instrumentation.builder(this.getClas
s()); |
| 24 * // save the file | 24 * // save the file |
| 25 * instrumentation.metric("chars", fileLength).log(); | 25 * instrumentation.metric("chars", fileLength).log(); |
| 26 * </pre> | 26 * </pre> |
| 27 * The {@code Instrumentation.builder} method creates a new {@link Instrumentati
onBuilderinstrumentation builder} and records the time at which it was created.
The{@link InstrumentationBuilder#metric(String,long)} appends the information sp
ecified by the | 27 * The {@code Instrumentation.builder} method creates a new {@link Instrumentati
onBuilderinstrumentation builder} and records the time at which it was created.
The{@link InstrumentationBuilder#metric(String,long)} appends the information sp
ecified by the |
| 28 * arguments and records the time at which the method is called so that the time
to complete the | 28 * arguments and records the time at which the method is called so that the time
to complete the |
| 29 * save operation can be calculated. The {@code log} method tells the builder th
at all of the data | 29 * save operation can be calculated. The {@code log} method tells the builder th
at all of the data |
| 30 * has been collected and that the resulting information should be logged. | 30 * has been collected and that the resulting information should be logged. |
| 31 * @coverage dart.engine.utilities |
| 31 */ | 32 */ |
| 32 class Instrumentation { | 33 class Instrumentation { |
| 33 /** | 34 /** |
| 34 * A builder that will silently ignore all data and logging requests. | 35 * A builder that will silently ignore all data and logging requests. |
| 35 */ | 36 */ |
| 36 static InstrumentationBuilder _NULL_INSTRUMENTATION_BUILDER = new Instrumentat
ionBuilder_7(); | 37 static InstrumentationBuilder _NULL_INSTRUMENTATION_BUILDER = new Instrumentat
ionBuilder_8(); |
| 37 /** | 38 /** |
| 38 * An instrumentation logger that can be used when no other instrumentation lo
gger has been | 39 * An instrumentation logger that can be used when no other instrumentation lo
gger has been |
| 39 * configured. This logger will silently ignore all data and logging requests. | 40 * configured. This logger will silently ignore all data and logging requests. |
| 40 */ | 41 */ |
| 41 static InstrumentationLogger _NULL_LOGGER = new InstrumentationLogger_8(); | 42 static InstrumentationLogger _NULL_LOGGER = new InstrumentationLogger_9(); |
| 42 /** | 43 /** |
| 43 * The current instrumentation logger. | 44 * The current instrumentation logger. |
| 44 */ | 45 */ |
| 45 static InstrumentationLogger _CURRENT_LOGGER = _NULL_LOGGER; | 46 static InstrumentationLogger _CURRENT_LOGGER = _NULL_LOGGER; |
| 46 /** | 47 /** |
| 47 * Create a builder that can collect the data associated with an operation. | 48 * Create a builder that can collect the data associated with an operation. |
| 48 * @param clazz the class performing the operation (not {@code null}) | 49 * @param clazz the class performing the operation (not {@code null}) |
| 49 * @return the builder that was created (not {@code null}) | 50 * @return the builder that was created (not {@code null}) |
| 50 */ | 51 */ |
| 51 static InstrumentationBuilder builder(Type clazz) => _CURRENT_LOGGER.createBui
lder(clazz.toString()); | 52 static InstrumentationBuilder builder(Type clazz) => _CURRENT_LOGGER.createBui
lder(clazz.toString()); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 66 */ | 67 */ |
| 67 static void set logger(InstrumentationLogger logger3) { | 68 static void set logger(InstrumentationLogger logger3) { |
| 68 _CURRENT_LOGGER = logger3 == null ? _NULL_LOGGER : logger3; | 69 _CURRENT_LOGGER = logger3 == null ? _NULL_LOGGER : logger3; |
| 69 } | 70 } |
| 70 /** | 71 /** |
| 71 * Prevent the creation of instances of this class | 72 * Prevent the creation of instances of this class |
| 72 */ | 73 */ |
| 73 Instrumentation() { | 74 Instrumentation() { |
| 74 } | 75 } |
| 75 } | 76 } |
| 76 class InstrumentationBuilder_7 implements InstrumentationBuilder { | 77 class InstrumentationBuilder_8 implements InstrumentationBuilder { |
| 77 InstrumentationBuilder data(String name, int value) => this; | 78 InstrumentationBuilder data(String name, int value) => this; |
| 78 InstrumentationBuilder data2(String name, String value) => this; | 79 InstrumentationBuilder data2(String name, String value) => this; |
| 79 InstrumentationBuilder data3(String name, List<String> value) => this; | 80 InstrumentationBuilder data3(String name, List<String> value) => this; |
| 80 InstrumentationLevel get instrumentationLevel => InstrumentationLevel.OFF; | 81 InstrumentationLevel get instrumentationLevel => InstrumentationLevel.OFF; |
| 81 void log() { | 82 void log() { |
| 82 } | 83 } |
| 83 InstrumentationBuilder metric(String name, int value) => this; | 84 InstrumentationBuilder metric(String name, int value) => this; |
| 84 InstrumentationBuilder metric2(String name, String value) => this; | 85 InstrumentationBuilder metric2(String name, String value) => this; |
| 85 InstrumentationBuilder metric3(String name, List<String> value) => this; | 86 InstrumentationBuilder metric3(String name, List<String> value) => this; |
| 86 } | 87 } |
| 87 class InstrumentationLogger_8 implements InstrumentationLogger { | 88 class InstrumentationLogger_9 implements InstrumentationLogger { |
| 88 InstrumentationBuilder createBuilder(String name) => Instrumentation._NULL_INS
TRUMENTATION_BUILDER; | 89 InstrumentationBuilder createBuilder(String name) => Instrumentation._NULL_INS
TRUMENTATION_BUILDER; |
| 89 } | 90 } |
| 90 /** | 91 /** |
| 91 * The interface {@code InstrumentationBuilder} defines the behavior of objects
used to collect data | 92 * The interface {@code InstrumentationBuilder} defines the behavior of objects
used to collect data |
| 92 * about an operation that has occurred and record that data through an instrume
ntation logger. | 93 * about an operation that has occurred and record that data through an instrume
ntation logger. |
| 93 * <p> | 94 * <p> |
| 94 * For an example of using objects that implement this interface, see {@link Ins
trumentation}. | 95 * For an example of using objects that implement this interface, see {@link Ins
trumentation}. |
| 96 * @coverage dart.engine.utilities |
| 95 */ | 97 */ |
| 96 abstract class InstrumentationBuilder { | 98 abstract class InstrumentationBuilder { |
| 97 /** | 99 /** |
| 98 * Append the given data to the data being collected by this builder. The info
rmation is declared | 100 * Append the given data to the data being collected by this builder. The info
rmation is declared |
| 99 * to potentially contain data that is either user identifiable or contains us
er intellectual | 101 * to potentially contain data that is either user identifiable or contains us
er intellectual |
| 100 * property (but is not guaranteed to contain either). | 102 * property (but is not guaranteed to contain either). |
| 101 * @param name the name used to identify the data | 103 * @param name the name used to identify the data |
| 102 * @param value the value of the data to be collected | 104 * @param value the value of the data to be collected |
| 103 * @return this builder | 105 * @return this builder |
| 104 */ | 106 */ |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 * @param name the name used to identify the data | 159 * @param name the name used to identify the data |
| 158 * @param value the value of the data to be collected | 160 * @param value the value of the data to be collected |
| 159 * @return this builder | 161 * @return this builder |
| 160 */ | 162 */ |
| 161 InstrumentationBuilder metric3(String name, List<String> value); | 163 InstrumentationBuilder metric3(String name, List<String> value); |
| 162 } | 164 } |
| 163 /** | 165 /** |
| 164 * The instrumentation recording level representing (1) recording {@link #EVERYT
HING} recording of | 166 * The instrumentation recording level representing (1) recording {@link #EVERYT
HING} recording of |
| 165 * all instrumentation data, (2) recording only {@link #METRICS} information, or
(3) recording | 167 * all instrumentation data, (2) recording only {@link #METRICS} information, or
(3) recording |
| 166 * turned {@link #OFF} in which case nothing is recorded. | 168 * turned {@link #OFF} in which case nothing is recorded. |
| 169 * @coverage dart.engine.utilities |
| 167 */ | 170 */ |
| 168 class InstrumentationLevel { | 171 class InstrumentationLevel { |
| 169 /** | 172 /** |
| 170 * Recording all instrumented information | 173 * Recording all instrumented information |
| 171 */ | 174 */ |
| 172 static final InstrumentationLevel EVERYTHING = new InstrumentationLevel('EVERY
THING', 0); | 175 static final InstrumentationLevel EVERYTHING = new InstrumentationLevel('EVERY
THING', 0); |
| 173 /** | 176 /** |
| 174 * Recording only metrics | 177 * Recording only metrics |
| 175 */ | 178 */ |
| 176 static final InstrumentationLevel METRICS = new InstrumentationLevel('METRICS'
, 1); | 179 static final InstrumentationLevel METRICS = new InstrumentationLevel('METRICS'
, 1); |
| 177 /** | 180 /** |
| 178 * Nothing recorded | 181 * Nothing recorded |
| 179 */ | 182 */ |
| 180 static final InstrumentationLevel OFF = new InstrumentationLevel('OFF', 2); | 183 static final InstrumentationLevel OFF = new InstrumentationLevel('OFF', 2); |
| 181 static final List<InstrumentationLevel> values = [EVERYTHING, METRICS, OFF]; | 184 static final List<InstrumentationLevel> values = [EVERYTHING, METRICS, OFF]; |
| 182 final String __name; | 185 final String __name; |
| 183 final int __ordinal; | 186 final int __ordinal; |
| 187 int get ordinal => __ordinal; |
| 184 InstrumentationLevel(this.__name, this.__ordinal) { | 188 InstrumentationLevel(this.__name, this.__ordinal) { |
| 185 } | 189 } |
| 186 String toString() => __name; | 190 String toString() => __name; |
| 187 } | 191 } |
| 188 /** | 192 /** |
| 189 * The interface {@code InstrumentationLogger} defines the behavior of objects t
hat are used to log | 193 * The interface {@code InstrumentationLogger} defines the behavior of objects t
hat are used to log |
| 190 * instrumentation data. | 194 * instrumentation data. |
| 191 * <p> | 195 * <p> |
| 192 * For an example of using objects that implement this interface, see {@link Ins
trumentation}. | 196 * For an example of using objects that implement this interface, see {@link Ins
trumentation}. |
| 197 * @coverage dart.engine.utilities |
| 193 */ | 198 */ |
| 194 abstract class InstrumentationLogger { | 199 abstract class InstrumentationLogger { |
| 195 /** | 200 /** |
| 196 * Create a builder that can collect the data associated with an operation ide
ntified by the given | 201 * Create a builder that can collect the data associated with an operation ide
ntified by the given |
| 197 * name. | 202 * name. |
| 198 * @param name the name used to uniquely identify the operation | 203 * @param name the name used to uniquely identify the operation |
| 199 * @return the builder that was created | 204 * @return the builder that was created |
| 200 */ | 205 */ |
| 201 InstrumentationBuilder createBuilder(String name); | 206 InstrumentationBuilder createBuilder(String name); |
| 202 } | 207 } |
| OLD | NEW |