8000 remove debug leftovers by shimonewman · Pull Request #7531 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

remove debug leftovers #7531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/Appwrite/Platform/Workers/Usage.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,6 @@ public function action(Message $message, callable $getProjectDB): void
getProjectDB: $getProjectDB
);
}
if ($project->getInternalId() == self::DEBUG_PROJECT_ID) {
var_dump([
'type' => 'payload',
'project' => $project->getInternalId(),
'database' => $project['database'] ?? '',
$payload['metrics']
]);

var_dump('==========================');
}

self::$stats[$projectId]['project'] = $project;
foreach ($payload['metrics'] ?? [] as $metric) {
Expand All @@ -91,7 +81,6 @@ public function action(Message $message, callable $getProjectDB): void
}
}


/**
* On Documents that tied by relations like functions>deployments>build || documents>collection>database || buckets>files.
* When we remove a parent document we need to deduct his children aggregation from the project scope.
Expand Down
35 changes: 0 additions & 35 deletions src/Appwrite/Platform/Workers/UsageHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ public function action($register, $getProjectDB): void

try {
$dbForProject = $getProjectDB($data['project']);
if ($projectInternalId == 85293) {
var_dump([
'project' => $projectInternalId,
'database' => $database,
'time' => DateTime::now(),
'data' => $data['keys']
]);
}
foreach ($data['keys'] ?? [] as $key => $value) {
if ($value == 0) {
continue;
Expand All @@ -75,15 +67,6 @@ public function action($register, $getProjectDB): void
$id = \md5("{$time}_{$period}_{$key}");

try {
if ($projectInternalId == self::DEBUG_PROJECT_ID) {
var_dump([
'type' => 'create',
'period' => $period,
'metric' => $key,
'id' => $id,
'value' => $value
]);
}
$dbForProject->createDocument('stats_v2', new Document([
'$id' => $id,
'period' => $period,
Expand All @@ -94,31 +77,13 @@ public function action($register, $getProjectDB): void
]));
} catch (Duplicate $th) {
if ($value < 0) {
if ($projectInternalId == self::DEBUG_PROJECT_ID) {
var_dump([
'type' => 'decrease',
'period' => $period,
'metric' => $key,
'id' => $id,
'value' => $value
]);
}
$dbForProject->decreaseDocumentAttribute(
'stats_v2',
$id,
'value',
abs($value)
);
} else {
if ($projectInternalId == self::DEBUG_PROJECT_ID) {
var_dump([
'type' => 'increase',
'period' => $period,
'metric' => $key,
'id' => $id,
'value' => $value
]);
}
$dbForProject->increaseDocumentAttribute(
'stats_v2',
$id,
Expand Down
0