Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: pkg/analysis_server/test/integration/support/integration_test_methods.dart

Issue 2922603002: Add an analytics domain to the analysis server. (Closed)
Patch Set: improved docs Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // This file has been automatically generated. Please do not edit it manually. 5 // This file has been automatically generated. Please do not edit it manually.
6 // To regenerate the file, use the script 6 // To regenerate the file, use the script
7 // "pkg/analysis_server/tool/spec/generate_files". 7 // "pkg/analysis_server/tool/spec/generate_files".
8 8
9 /** 9 /**
10 * Convenience methods for running integration tests 10 * Convenience methods for running integration tests
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 * The diagnostic server port. 1730 * The diagnostic server port.
1731 */ 1731 */
1732 Future<DiagnosticGetServerPortResult> sendDiagnosticGetServerPort() async { 1732 Future<DiagnosticGetServerPortResult> sendDiagnosticGetServerPort() async {
1733 var result = await server.send("diagnostic.getServerPort", null); 1733 var result = await server.send("diagnostic.getServerPort", null);
1734 ResponseDecoder decoder = new ResponseDecoder(null); 1734 ResponseDecoder decoder = new ResponseDecoder(null);
1735 return new DiagnosticGetServerPortResult.fromJson( 1735 return new DiagnosticGetServerPortResult.fromJson(
1736 decoder, 'result', result); 1736 decoder, 'result', result);
1737 } 1737 }
1738 1738
1739 /** 1739 /**
1740 * Query whether analytics is enabled.
1741 *
1742 * This flag controls whether the analysis server sends any analytics data to
1743 * the cloud. If disabled, the analysis server doesn not send any analytics
1744 * data, and any data sent to it by clients (from sendEvent and sendTiming)
1745 * will be ignored.
1746 *
1747 * The value of this flag can be changed by other tools outside of the
1748 * analysis server's process. When you query the flag, you get the value of
1749 * the flag at a given moment. Clients should not use the value returned to
1750 * decide whether or not to send the sendEvent and sendTiming requests. Those
1751 * requests should be used unconditionally and server will determine whether
1752 * or not it is appropriate to forward the information to the cloud at the
1753 * time each request is received.
1754 *
1755 * Returns
1756 *
1757 * enabled: bool
1758 *
1759 * Whether sending analytics is enabled or not.
1760 */
1761 Future<AnalyticsIsEnabledResult> sendAnalyticsIsEnabled() async {
1762 var result = await server.send("analytics.isEnabled", null);
1763 ResponseDecoder decoder = new ResponseDecoder(null);
1764 return new AnalyticsIsEnabledResult.fromJson(decoder, 'result', result);
1765 }
1766
1767 /**
1768 * Enable or disable the sending of analytics data. Note that there are other
1769 * ways for users to change this setting, so clients cannot assume that they
1770 * have complete control over this setting. In particular, there is no
1771 * guarantee that the result returned by the isEnabled request will match the
1772 * last value set via this request.
1773 *
1774 * Parameters
1775 *
1776 * value: bool
1777 *
1778 * Enable or disable analytics.
1779 */
1780 Future sendAnalyticsEnable(bool value) async {
1781 var params = new AnalyticsEnableParams(value).toJson();
1782 var result = await server.send("analytics.enable", params);
1783 outOfTestExpect(result, isNull);
1784 return null;
1785 }
1786
1787 /**
1788 * Send information about client events.
1789 *
1790 * Ask the analysis server to include the fact that an action was performed
1791 * in the client as part of the analytics data being sent. The data will only
1792 * be included if the sending of analytics data is enabled at the time the
1793 * request is processed. The action that was performed is indicated by the
1794 * value of the action field.
1795 *
1796 * The value of the action field should not include the identity of the
1797 * client. The analytics data sent by server will include the client id
1798 * passed in using the --client-id command-line argument. The request will be
1799 * ignored if the client id was not provided when server was started.
1800 *
1801 * Parameters
1802 *
1803 * action: String
1804 *
1805 * The value used to indicate which action was performed.
1806 */
1807 Future sendAnalyticsSendEvent(String action) async {
1808 var params = new AnalyticsSendEventParams(action).toJson();
1809 var result = await server.send("analytics.sendEvent", params);
1810 outOfTestExpect(result, isNull);
1811 return null;
1812 }
1813
1814 /**
1815 * Send timing information for client events (e.g. code completions).
1816 *
1817 * Ask the analysis server to include the fact that a timed event occurred as
1818 * part of the analytics data being sent. The data will only be included if
1819 * the sending of analytics data is enabled at the time the request is
1820 * processed.
1821 *
1822 * The value of the event field should not include the identity of the
1823 * client. The analytics data sent by server will include the client id
1824 * passed in using the --client-id command-line argument. The request will be
1825 * ignored if the client id was not provided when server was started.
1826 *
1827 * Parameters
1828 *
1829 * event: String
1830 *
1831 * The name of the event.
1832 *
1833 * millis: int
1834 *
1835 * The duration of the event in milliseconds.
1836 */
1837 Future sendAnalyticsSendTiming(String event, int millis) async {
1838 var params = new AnalyticsSendTimingParams(event, millis).toJson();
1839 var result = await server.send("analytics.sendTiming", params);
1840 outOfTestExpect(result, isNull);
1841 return null;
1842 }
1843
1844 /**
1740 * Initialize the fields in InttestMixin, and ensure that notifications will 1845 * Initialize the fields in InttestMixin, and ensure that notifications will
1741 * be handled. 1846 * be handled.
1742 */ 1847 */
1743 void initializeInttestMixin() { 1848 void initializeInttestMixin() {
1744 _onServerConnected = 1849 _onServerConnected =
1745 new StreamController<ServerConnectedParams>(sync: true); 1850 new StreamController<ServerConnectedParams>(sync: true);
1746 onServerConnected = _onServerConnected.stream.asBroadcastStream(); 1851 onServerConnected = _onServerConnected.stream.asBroadcastStream();
1747 _onServerError = new StreamController<ServerErrorParams>(sync: true); 1852 _onServerError = new StreamController<ServerErrorParams>(sync: true);
1748 onServerError = _onServerError.stream.asBroadcastStream(); 1853 onServerError = _onServerError.stream.asBroadcastStream();
1749 _onServerStatus = new StreamController<ServerStatusParams>(sync: true); 1854 _onServerStatus = new StreamController<ServerStatusParams>(sync: true);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 outOfTestExpect(params, isExecutionLaunchDataParams); 1987 outOfTestExpect(params, isExecutionLaunchDataParams);
1883 _onExecutionLaunchData.add( 1988 _onExecutionLaunchData.add(
1884 new ExecutionLaunchDataParams.fromJson(decoder, 'params', params)); 1989 new ExecutionLaunchDataParams.fromJson(decoder, 'params', params));
1885 break; 1990 break;
1886 default: 1991 default:
1887 fail('Unexpected notification: $event'); 1992 fail('Unexpected notification: $event');
1888 break; 1993 break;
1889 } 1994 }
1890 } 1995 }
1891 } 1996 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698