mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: improve analytics (#11714)
* chore: improve analytics * lint * log more events, add note in UPDATING.md * handling base class * more events\! * get ref through * right before @expose * fix context * touchups
This commit is contained in:
committed by
GitHub
parent
9215a31fa2
commit
0504cf1a00
@@ -185,6 +185,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def post(self) -> Response:
|
||||
"""Creates a new Database
|
||||
---
|
||||
@@ -247,6 +248,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def put( # pylint: disable=too-many-return-statements, arguments-differ
|
||||
self, pk: int
|
||||
) -> Response:
|
||||
@@ -320,6 +322,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def delete(self, pk: int) -> Response: # pylint: disable=arguments-differ
|
||||
"""Deletes a Database
|
||||
---
|
||||
@@ -370,6 +373,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
@safe
|
||||
@rison(database_schemas_query_schema)
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def schemas(self, pk: int, **kwargs: Any) -> FlaskResponse:
|
||||
"""Get all schemas from a database
|
||||
---
|
||||
@@ -423,8 +427,8 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
@protect()
|
||||
@check_datasource_access
|
||||
@safe
|
||||
@event_logger.log_this
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def table_metadata(
|
||||
self, database: Database, table_name: str, schema_name: str
|
||||
) -> FlaskResponse:
|
||||
@@ -480,8 +484,8 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
@protect()
|
||||
@check_datasource_access
|
||||
@safe
|
||||
@event_logger.log_this
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def select_star(
|
||||
self, database: Database, table_name: str, schema_name: Optional[str] = None
|
||||
) -> FlaskResponse:
|
||||
@@ -537,8 +541,8 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
@expose("/test_connection", methods=["POST"])
|
||||
@protect()
|
||||
@safe
|
||||
@event_logger.log_this
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def test_connection( # pylint: disable=too-many-return-statements
|
||||
self,
|
||||
) -> FlaskResponse:
|
||||
@@ -618,6 +622,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def related_objects(self, pk: int) -> Response:
|
||||
"""Get charts and dashboards count associated to a database
|
||||
---
|
||||
@@ -676,6 +681,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_export_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def export(self, **kwargs: Any) -> Response:
|
||||
"""Export database(s) with associated datasets
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user