pandas.conf 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. # netdata python.d.plugin configuration for pandas
  2. #
  3. # This file is in YaML format. Generally the format is:
  4. #
  5. # name: value
  6. #
  7. # There are 2 sections:
  8. # - global variables
  9. # - one or more JOBS
  10. #
  11. # JOBS allow you to collect values from multiple sources.
  12. # Each source will have its own set of charts.
  13. #
  14. # JOB parameters have to be indented (using spaces only, example below).
  15. # ----------------------------------------------------------------------
  16. # Global Variables
  17. # These variables set the defaults for all JOBs, however each JOB
  18. # may define its own, overriding the defaults.
  19. # update_every sets the default data collection frequency.
  20. # If unset, the python.d.plugin default is used.
  21. update_every: 5
  22. # priority controls the order of charts at the netdata dashboard.
  23. # Lower numbers move the charts towards the top of the page.
  24. # If unset, the default for python.d.plugin is used.
  25. # priority: 60000
  26. # penalty indicates whether to apply penalty to update_every in case of failures.
  27. # Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
  28. # penalty: yes
  29. # autodetection_retry sets the job re-check interval in seconds.
  30. # The job is not deleted if check fails.
  31. # Attempts to start the job are made once every autodetection_retry.
  32. # This feature is disabled by default.
  33. # autodetection_retry: 0
  34. # ----------------------------------------------------------------------
  35. # JOBS (data collection sources)
  36. #
  37. # The default JOBS share the same *name*. JOBS with the same name
  38. # are mutually exclusive. Only one of them will be allowed running at
  39. # any time. This allows autodetection to try several alternatives and
  40. # pick the one that works.
  41. #
  42. # Any number of jobs is supported.
  43. #
  44. # All python.d.plugin JOBS (for all its modules) support a set of
  45. # predefined parameters. These are:
  46. #
  47. # job_name:
  48. # name: myname # the JOB's name as it will appear on the dashboard
  49. # # dashboard (by default is the job_name)
  50. # # JOBs sharing a name are mutually exclusive
  51. # update_every: 1 # the JOB's data collection frequency
  52. # priority: 60000 # the JOB's order on the dashboard
  53. # penalty: yes # the JOB's penalty
  54. # autodetection_retry: 0 # the JOB's re-check interval in seconds
  55. #
  56. # Additionally to the above, example also supports the following:
  57. #
  58. # num_lines: 4 # the number of lines to create
  59. # lower: 0 # the lower bound of numbers to randomly sample from
  60. # upper: 100 # the upper bound of numbers to randomly sample from
  61. #
  62. # ----------------------------------------------------------------------
  63. # AUTO-DETECTION JOBS
  64. # Some example configurations, enable this collector, uncomment and example below and restart netdata to enable.
  65. # example pulling some hourly temperature data, a chart for today forecast (mean,min,max) and another chart for current.
  66. # temperature:
  67. # name: "temperature"
  68. # update_every: 5
  69. # chart_configs:
  70. # - name: "temperature_forecast_by_city"
  71. # title: "Temperature By City - Today Forecast"
  72. # family: "temperature.today"
  73. # context: "pandas.temperature"
  74. # type: "line"
  75. # units: "Celsius"
  76. # df_steps: >
  77. # pd.DataFrame.from_dict(
  78. # {city: requests.get(f'https://api.open-meteo.com/v1/forecast?latitude={lat}&longitude={lng}&hourly=temperature_2m').json()['hourly']['temperature_2m']
  79. # for (city,lat,lng)
  80. # in [
  81. # ('dublin', 53.3441, -6.2675),
  82. # ('athens', 37.9792, 23.7166),
  83. # ('london', 51.5002, -0.1262),
  84. # ('berlin', 52.5235, 13.4115),
  85. # ('paris', 48.8567, 2.3510),
  86. # ('madrid', 40.4167, -3.7033),
  87. # ('new_york', 40.71, -74.01),
  88. # ('los_angeles', 34.05, -118.24),
  89. # ]
  90. # }
  91. # );
  92. # df.describe(); # get aggregate stats for each city;
  93. # df.transpose()[['mean', 'max', 'min']].reset_index(); # just take mean, min, max;
  94. # df.rename(columns={'index':'city'}); # some column renaming;
  95. # df.pivot(columns='city').mean().to_frame().reset_index(); # force to be one row per city;
  96. # df.rename(columns={0:'degrees'}); # some column renaming;
  97. # pd.concat([df, df['city']+'_'+df['level_0']], axis=1); # add new column combining city and summary measurement label;
  98. # df.rename(columns={0:'measurement'}); # some column renaming;
  99. # df[['measurement', 'degrees']].set_index('measurement'); # just take two columns we want;
  100. # df.sort_index(); # sort by city name;
  101. # df.transpose(); # transpose so its just one wide row;
  102. # - name: "temperature_current_by_city"
  103. # title: "Temperature By City - Current"
  104. # family: "temperature.current"
  105. # context: "pandas.temperature"
  106. # type: "line"
  107. # units: "Celsius"
  108. # df_steps: >
  109. # pd.DataFrame.from_dict(
  110. # {city: requests.get(f'https://api.open-meteo.com/v1/forecast?latitude={lat}&longitude={lng}&current_weather=true').json()['current_weather']
  111. # for (city,lat,lng)
  112. # in [
  113. # ('dublin', 53.3441, -6.2675),
  114. # ('athens', 37.9792, 23.7166),
  115. # ('london', 51.5002, -0.1262),
  116. # ('berlin', 52.5235, 13.4115),
  117. # ('paris', 48.8567, 2.3510),
  118. # ('madrid', 40.4167, -3.7033),
  119. # ('new_york', 40.71, -74.01),
  120. # ('los_angeles', 34.05, -118.24),
  121. # ]
  122. # }
  123. # );
  124. # df.transpose();
  125. # df[['temperature']];
  126. # df.transpose();
  127. # example showing a read_csv from a url and some light pandas data wrangling.
  128. # pull data in csv format from london demo server and then ratio of user cpus over system cpu averaged over last 60 seconds.
  129. # example_csv:
  130. # name: "example_csv"
  131. # update_every: 2
  132. # chart_configs:
  133. # - name: "london_system_cpu"
  134. # title: "London System CPU - Ratios"
  135. # family: "london_system_cpu"
  136. # context: "pandas"
  137. # type: "line"
  138. # units: "n"
  139. # df_steps: >
  140. # pd.read_csv('https://london.my-netdata.io/api/v1/data?chart=system.cpu&format=csv&after=-60', storage_options={'User-Agent': 'netdata'});
  141. # df.drop('time', axis=1);
  142. # df.mean().to_frame().transpose();
  143. # df.apply(lambda row: (row.user / row.system), axis = 1).to_frame();
  144. # df.rename(columns={0:'average_user_system_ratio'});
  145. # df*100;
  146. # example showing a read_json from a url and some light pandas data wrangling.
  147. # pull data in json format (using requests.get() if json data is too complex for pd.read_json() ) from london demo server and work out 'total_bandwidth'.
  148. # example_json:
  149. # name: "example_json"
  150. # update_every: 2
  151. # chart_configs:
  152. # - name: "london_system_net"
  153. # title: "London System Net - Total Bandwidth"
  154. # family: "london_system_net"
  155. # context: "pandas"
  156. # type: "area"
  157. # units: "kilobits/s"
  158. # df_steps: >
  159. # pd.DataFrame(requests.get('https://london.my-netdata.io/api/v1/data?chart=system.net&format=json&after=-1').json()['data'], columns=requests.get('https://london.my-netdata.io/api/v1/data?chart=system.net&format=json&after=-1').json()['labels']);
  160. # df.drop('time', axis=1);
  161. # abs(df);
  162. # df.sum(axis=1).to_frame();
  163. # df.rename(columns={0:'total_bandwidth'});
  164. # example showing a read_xml from a url and some light pandas data wrangling.
  165. # pull weather forecast data in xml format, use xpath to pull out temperature forecast.
  166. # example_xml:
  167. # name: "example_xml"
  168. # update_every: 2
  169. # line_sep: "|"
  170. # chart_configs:
  171. # - name: "temperature_forcast"
  172. # title: "Temperature Forecast"
  173. # family: "temp"
  174. # context: "pandas.temp"
  175. # type: "line"
  176. # units: "celsius"
  177. # df_steps: >
  178. # pd.read_xml('http://metwdb-openaccess.ichec.ie/metno-wdb2ts/locationforecast?lat=54.7210798611;long=-8.7237392806', xpath='./product/time[1]/location/temperature', parser='etree')|
  179. # df.rename(columns={'value': 'dublin'})|
  180. # df[['dublin']]|