endstone.metrics
Classes
| Name | Description |
|---|---|
AdvancedBarChart | |
AdvancedPie | |
CustomChart | Represents a custom chart. |
DrilldownPie | |
Metrics | |
MultiLineChart | |
SimpleBarChart | |
SimplePie | |
SingleLineChart |
classAdvancedBarChart
Bases: CustomChart
Parameters
Methods
| Name | Description |
|---|---|
get_chart_data | Gets the data for the advanced bar chart. |
Attributes
| Name | Type | Description |
|---|---|---|
get_values |
attrget_values
get_valuesmethget_chart_data
get_chart_data() -> dict | NoneGets the data for the advanced bar chart.
Returns
| Type | Description |
|---|---|
dict | None | dict | None: A dictionary with the chart data. |
classAdvancedPie
Bases: CustomChart
Parameters
Methods
| Name | Description |
|---|---|
get_chart_data | Gets the data for the advanced pie chart. |
Attributes
| Name | Type | Description |
|---|---|---|
get_values |
attrget_values
get_valuesmethget_chart_data
get_chart_data() -> dict | NoneGets the data for the advanced pie chart.
Returns
| Type | Description |
|---|---|
dict | None | dict | None: A dictionary with the chart data. |
classCustomChart
Bases: ABC
CustomChart(chart_id: str)Represents a custom chart.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
chart_id | str | The id of the chart. | required |
Raises
| Type | Description |
|---|---|
ValueError | If chart_id is None or empty. |
Methods
| Name | Description |
|---|---|
get_chart_data | Gets the data for the chart. |
Attributes
| Name | Type | Description |
|---|---|---|
chart_id |
attrchart_id
chart_idmethget_chart_dataabstractmethod
get_chart_data() -> dict | NoneGets the data for the chart.
Returns
| Name | Type | Description |
|---|---|---|
dict | dict | None | A dictionary with the chart data. |
Raises
| Type | Description |
|---|---|
Exception | If there is an error getting the chart data. |
classDrilldownPie
Bases: CustomChart
Parameters
Methods
| Name | Description |
|---|---|
get_chart_data | Gets the data for the advanced pie chart. |
Attributes
| Name | Type | Description |
|---|---|---|
get_values |
attrget_values
get_valuesmethget_chart_data
get_chart_data() -> dict | NoneGets the data for the advanced pie chart.
Returns
| Type | Description |
|---|---|
dict | None | dict | None: A dictionary with the chart data. |
classMetrics
Bases: MetricsBase
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
plugin | Plugin | Your plugin instance. | required |
service_id | int | The id of the service. It can be found at https://bstats.org/what-is-my-plugin-id | required |
Methods
| Name | Description |
|---|---|
append_platform_data | Appends platform-specific data to the provided dict. |
append_service_data | Appends service-specific data to the provided dict. |
log_error | |
log_info | |
submit_task |
Attributes
| Name | Type | Description |
|---|---|---|
enabled | bool | |
service_enabled | bool |
attrenabledproperty
enabled: boolattrservice_enabledproperty
service_enabled: boolmethappend_platform_data
Appends platform-specific data to the provided dict.
methappend_service_data
Appends service-specific data to the provided dict.
methlog_error
methlog_info
log_info(message: str) -> Nonemethsubmit_task
submit_task(task: Callable[[], None]) -> NoneclassMultiLineChart
Bases: CustomChart
Parameters
Methods
| Name | Description |
|---|---|
get_chart_data | Gets the data for the multi-line chart. |
Attributes
| Name | Type | Description |
|---|---|---|
get_values |
attrget_values
get_valuesmethget_chart_data
get_chart_data() -> dict | NoneGets the data for the multi-line chart.
Returns
| Type | Description |
|---|---|
dict | None | dict | None: A dictionary with the chart data. |
classSimpleBarChart
Bases: CustomChart
Parameters
Methods
| Name | Description |
|---|---|
get_chart_data | Gets the data for the simple bar chart. |
Attributes
| Name | Type | Description |
|---|---|---|
get_values |
attrget_values
get_valuesmethget_chart_data
get_chart_data() -> dict | NoneGets the data for the simple bar chart.
Returns
| Type | Description |
|---|---|
dict | None | dict | None: A dictionary with the chart data. |
classSimplePie
Bases: CustomChart
Parameters
Methods
| Name | Description |
|---|---|
get_chart_data | Gets the data for the simple pie chart. |
Attributes
| Name | Type | Description |
|---|---|---|
get_value |
attrget_value
get_valuemethget_chart_data
get_chart_data() -> dict | NoneGets the data for the simple pie chart.
Returns
| Type | Description |
|---|---|
dict | None | dict | None: A dictionary with the chart data. |
classSingleLineChart
Bases: CustomChart
Parameters
Methods
| Name | Description |
|---|---|
get_chart_data | Gets the data for the simple pie chart. |
Attributes
| Name | Type | Description |
|---|---|---|
get_value |
attrget_value
get_valuemethget_chart_data
get_chart_data() -> dict | NoneGets the data for the simple pie chart.
Returns
| Type | Description |
|---|---|
dict | None | dict | None: A dictionary with the chart data. |