Remove missmappng and remove cu-watch fix.

pull/751/head
Andrey 2023-04-25 18:39:25 +03:00
rodzic ad06bf947f
commit e2c50c26b9
2 zmienionych plików z 25 dodań i 7 usunięć

Wyświetl plik

@ -175,13 +175,13 @@ async def status_handler(
subscriprions_type = reqired_field["subscription_type_id"]
for timescale in stats_update.timescales:
presigned_urls_response[subscription.id] = {}
presigned_urls_response[subscription_entity.entity_id] = {}
try:
result_key = f"{MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX}/{dashboard.blockchain_by_subscription_id[subscriprions_type]}/contracts_data/{subscription_entity.address}/{stats_update.dashboard_id}/v1/{timescale}.json"
object = s3_client.head_object(
Bucket=subscription.resource_data["bucket"], Key=result_key
Bucket=MOONSTREAM_S3_DASHBOARDS_DATA_BUCKET, Key=result_key
)
stats_presigned_url = s3_client.generate_presigned_url(
@ -194,7 +194,7 @@ async def status_handler(
HttpMethod="GET",
)
presigned_urls_response[subscription.id][timescale] = {
presigned_urls_response[subscription_entity.entity_id][timescale] = {
"url": stats_presigned_url,
"headers": {
"If-Modified-Since": (
@ -204,7 +204,7 @@ async def status_handler(
}
except Exception as err:
logger.warning(
f"Can't generate S3 presigned url in stats endpoint for Bucket:{subscription.resource_data['bucket']}, Key:{result_key} get error:{err}"
f"Can't generate S3 presigned url in stats endpoint for Bucket:{MOONSTREAM_S3_DASHBOARDS_DATA_BUCKET}, Key:{result_key} get error:{err}"
)
return presigned_urls_response

Wyświetl plik

@ -226,6 +226,8 @@ def generate_data(
response_labels: Dict[Any, Any] = {}
print(labels_time_series)
for created_date, label, count in labels_time_series:
if not response_labels.get(label):
response_labels[label] = []
@ -1056,8 +1058,6 @@ def stats_generate_api_task(
crawler_label = CRAWLER_LABEL
if address in ("0xdC0479CC5BbA033B3e7De9F178607150B3AbCe1f",):
crawler_label = "moonworm"
abi = None
if "abi" in subscription_by_id[subscription_id].secondary_fields:
abi = subscription_by_id[subscription_id].secondary_fields["abi"]
@ -1069,7 +1069,7 @@ def stats_generate_api_task(
abi_json = {}
else:
abi_json = abi
abi_json = json.loads(abi)
methods = generate_list_of_names(
type="function",
@ -1078,6 +1078,8 @@ def stats_generate_api_task(
abi_json=abi_json,
)
print(methods)
events = generate_list_of_names(
type="event",
subscription_filters=dashboard_subscription_filters,
@ -1085,7 +1087,14 @@ def stats_generate_api_task(
abi_json=abi_json,
)
print(events)
# Data for cards components
print(blockchain_type)
print(address)
print(crawler_label)
extention_data = generate_web3_metrics(
db_session=db_session,
events=events,
@ -1129,6 +1138,12 @@ def stats_generate_api_task(
)
s3_data_object["methods"] = functions_calls_data
print(blockchain_type)
print(address)
print(crawler_label)
print(timescale)
print(start_date)
# Generate events timeseries
events_data = generate_data(
db_session=db_session,
@ -1140,6 +1155,9 @@ def stats_generate_api_task(
metric_type="event",
crawler_label=crawler_label,
)
print(events_data)
s3_data_object["events"] = events_data
# push data to S3 bucket