Skip to content

Commit

Permalink
pkp/pkp-lib#9822 Increase timeout and improve DB table indexes for us…
Browse files Browse the repository at this point in the history
…age stats jobs
  • Loading branch information
bozana committed Feb 6, 2025
1 parent 390ec30 commit 3cde95d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions classes/migration/install/MetricsMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ public function up(): void
$table->string('city', 255)->default('');
$table->string('load_id', 50);

$table->index(['load_id', 'context_id', 'ip'], 'ust_load_id_context_id_ip');
$table->index(['load_id', 'context_id', 'ip', 'user_agent', 'canonical_url'], 'ust_load_id_context_id_ip_ua_url');
});

// Usage stats unique item investigations temporary records
Expand Down Expand Up @@ -306,7 +306,7 @@ public function up(): void
$table->string('city', 255)->default('');
$table->string('load_id', 50);

$table->index(['load_id', 'context_id', 'ip'], 'usii_load_id_context_id_ip');
$table->index(['load_id', 'context_id', 'ip', 'user_agent'], 'usii_load_id_context_id_ip_ua');
});

// Usage stats unique item requests temporary records
Expand Down Expand Up @@ -341,7 +341,7 @@ public function up(): void
$table->string('city', 255)->default('');
$table->string('load_id', 50);

$table->index(['load_id', 'context_id', 'ip'], 'usir_load_id_context_id_ip');
$table->index(['load_id', 'context_id', 'ip', 'user_agent'], 'usir_load_id_context_id_ip_ua');
});

// Usage stats institution temporary records
Expand Down
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
<upgrade minversion="3.4.0.0" maxversion="3.4.0.5">
<!-- Only new 3.4 installations need this fix -->
<migration class="PKP\migration\upgrade\v3_4_0\I8592_SiteNotificationSubscriptions"/>
<migration class="PKP\migration\upgrade\v3_4_0\I9822_ChangeUsageStatsTemporaryTablesIndexes"/>
</upgrade>

<upgrade minversion="3.1.0.0" maxversion="3.4.9.9">
Expand Down
2 changes: 2 additions & 0 deletions jobs/statistics/CompileUniqueInvestigations.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

class CompileUniqueInvestigations extends BaseJob
{
public int $timeout = 600;

/**
* Create a new job instance.
*
Expand Down
2 changes: 2 additions & 0 deletions jobs/statistics/CompileUniqueRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

class CompileUniqueRequests extends BaseJob
{
public int $timeout = 600;

/**
* Create a new job instance.
*
Expand Down

0 comments on commit 3cde95d

Please sign in to comment.