Skip to content
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
2 changes: 2 additions & 0 deletions docs/Model/Resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ Name | Type | Description | Notes
**last_update** | **int** | last update as timestamp (in seconds) | [optional]
**external_download_url** | **string** | | [optional] [default to '']
**description** | **string** | | [optional]
**source_code_url** | **string** | | [optional] [default to '']
**donate_url** | **string** | | [optional] [default to '']

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
1 change: 1 addition & 0 deletions docs/Model/ResourceUpdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**resource_id** | **int** | | [optional]
**resource_version** | **string** | | [optional]
**download_count** | **int** | | [optional]
**post_date** | **int** | post date as timestamp (in seconds) | [optional]
**title** | **string** | | [optional]
**message** | **string** | | [optional]

Expand Down
80 changes: 74 additions & 6 deletions src/Model/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ class Resource implements ModelInterface, ArrayAccess, JsonSerializable
'first_release' => 'int',
'last_update' => 'int',
'external_download_url' => 'string',
'description' => 'string'
'description' => 'string',
'source_code_url' => 'string',
'donate_url' => 'string'
];

/**
Expand All @@ -95,7 +97,9 @@ class Resource implements ModelInterface, ArrayAccess, JsonSerializable
'first_release' => null,
'last_update' => null,
'external_download_url' => 'uri',
'description' => null
'description' => null,
'source_code_url' => 'uri',
'donate_url' => 'uri'
];

/**
Expand All @@ -118,7 +122,9 @@ class Resource implements ModelInterface, ArrayAccess, JsonSerializable
'first_release' => false,
'last_update' => false,
'external_download_url' => false,
'description' => false
'description' => false,
'source_code_url' => false,
'donate_url' => false
];

/**
Expand Down Expand Up @@ -221,7 +227,9 @@ public function isNullableSetToNull(string $property): bool
'first_release' => 'first_release',
'last_update' => 'last_update',
'external_download_url' => 'external_download_url',
'description' => 'description'
'description' => 'description',
'source_code_url' => 'source_code_url',
'donate_url' => 'donate_url'
];

/**
Expand All @@ -244,7 +252,9 @@ public function isNullableSetToNull(string $property): bool
'first_release' => 'setFirstRelease',
'last_update' => 'setLastUpdate',
'external_download_url' => 'setExternalDownloadUrl',
'description' => 'setDescription'
'description' => 'setDescription',
'source_code_url' => 'setSourceCodeUrl',
'donate_url' => 'setDonateUrl'
];

/**
Expand All @@ -267,7 +277,9 @@ public function isNullableSetToNull(string $property): bool
'first_release' => 'getFirstRelease',
'last_update' => 'getLastUpdate',
'external_download_url' => 'getExternalDownloadUrl',
'description' => 'getDescription'
'description' => 'getDescription',
'source_code_url' => 'getSourceCodeUrl',
'donate_url' => 'getDonateUrl'
];

/**
Expand Down Expand Up @@ -341,6 +353,8 @@ public function __construct(?array $data = null)
$this->setIfExists('last_update', $data ?? [], null);
$this->setIfExists('external_download_url', $data ?? [], '');
$this->setIfExists('description', $data ?? [], null);
$this->setIfExists('source_code_url', $data ?? [], '');
$this->setIfExists('donate_url', $data ?? [], '');
}

/**
Expand Down Expand Up @@ -803,6 +817,60 @@ public function setDescription(?string $description): static

return $this;
}

/**
* Gets source_code_url
*
* @return string|null
*/
public function getSourceCodeUrl(): ?string
{
return $this->container['source_code_url'];
}

/**
* Sets source_code_url
*
* @param string|null $source_code_url source_code_url
*
* @return $this
*/
public function setSourceCodeUrl(?string $source_code_url): static
{
if (is_null($source_code_url)) {
throw new InvalidArgumentException('non-nullable source_code_url cannot be null');
}
$this->container['source_code_url'] = $source_code_url;

return $this;
}

/**
* Gets donate_url
*
* @return string|null
*/
public function getDonateUrl(): ?string
{
return $this->container['donate_url'];
}

/**
* Sets donate_url
*
* @param string|null $donate_url donate_url
*
* @return $this
*/
public function setDonateUrl(?string $donate_url): static
{
if (is_null($donate_url)) {
throw new InvalidArgumentException('non-nullable donate_url cannot be null');
}
$this->container['donate_url'] = $donate_url;

return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
Expand Down
34 changes: 34 additions & 0 deletions src/Model/ResourceUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class ResourceUpdate implements ModelInterface, ArrayAccess, JsonSerializable
'resource_id' => 'int',
'resource_version' => 'string',
'download_count' => 'int',
'post_date' => 'int',
'title' => 'string',
'message' => 'string'
];
Expand All @@ -76,6 +77,7 @@ class ResourceUpdate implements ModelInterface, ArrayAccess, JsonSerializable
'resource_id' => null,
'resource_version' => null,
'download_count' => null,
'post_date' => null,
'title' => null,
'message' => null
];
Expand All @@ -90,6 +92,7 @@ class ResourceUpdate implements ModelInterface, ArrayAccess, JsonSerializable
'resource_id' => false,
'resource_version' => false,
'download_count' => false,
'post_date' => false,
'title' => false,
'message' => false
];
Expand Down Expand Up @@ -184,6 +187,7 @@ public function isNullableSetToNull(string $property): bool
'resource_id' => 'resource_id',
'resource_version' => 'resource_version',
'download_count' => 'download_count',
'post_date' => 'post_date',
'title' => 'title',
'message' => 'message'
];
Expand All @@ -198,6 +202,7 @@ public function isNullableSetToNull(string $property): bool
'resource_id' => 'setResourceId',
'resource_version' => 'setResourceVersion',
'download_count' => 'setDownloadCount',
'post_date' => 'setPostDate',
'title' => 'setTitle',
'message' => 'setMessage'
];
Expand All @@ -212,6 +217,7 @@ public function isNullableSetToNull(string $property): bool
'resource_id' => 'getResourceId',
'resource_version' => 'getResourceVersion',
'download_count' => 'getDownloadCount',
'post_date' => 'getPostDate',
'title' => 'getTitle',
'message' => 'getMessage'
];
Expand Down Expand Up @@ -276,6 +282,7 @@ public function __construct(?array $data = null)
$this->setIfExists('resource_id', $data ?? [], null);
$this->setIfExists('resource_version', $data ?? [], null);
$this->setIfExists('download_count', $data ?? [], null);
$this->setIfExists('post_date', $data ?? [], null);
$this->setIfExists('title', $data ?? [], null);
$this->setIfExists('message', $data ?? [], null);
}
Expand Down Expand Up @@ -430,6 +437,33 @@ public function setDownloadCount(?int $download_count): static
return $this;
}

/**
* Gets post_date
*
* @return int|null
*/
public function getPostDate(): ?int
{
return $this->container['post_date'];
}

/**
* Sets post_date
*
* @param int|null $post_date post date as timestamp (in seconds)
*
* @return $this
*/
public function setPostDate(?int $post_date): static
{
if (is_null($post_date)) {
throw new InvalidArgumentException('non-nullable post_date cannot be null');
}
$this->container['post_date'] = $post_date;

return $this;
}

/**
* Gets title
*
Expand Down
3 changes: 3 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ protected function assertValidProject(Project $project): void
$this->assertNotNull($project->getData()->getDescription());
$this->assertNotNull($project->getData()->getFirstRelease());
$this->assertNotNull($project->getData()->getLastUpdate());
$this->assertNotNull($project->getData()->getSourceCodeUrl());
$this->assertNotNull($project->getData()->getDonateUrl());
}

protected function assertValidVersion(Version $version): void
Expand All @@ -89,6 +91,7 @@ protected function assertValidVersion(Version $version): void
$this->assertNotNull($version->getData()->getDownloadCount());
$this->assertNotNull($version->getData()->getTitle());
$this->assertNotNull($version->getData()->getMessage());
$this->assertNotNull($version->getData()->getPostDate());
}

protected function assertValidPaginatedList(PaginatedList $list): void
Expand Down
8 changes: 5 additions & 3 deletions tests/Unit/Client/Fixtures/getResource.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"currency": ""
},
"stats": {
"downloads": 246550,
"downloads": 253464,
"updates": 21,
"reviews": {
"unique": 91,
Expand All @@ -47,5 +47,7 @@
"external_download_url": "",
"first_release": 1527527040,
"last_update": 1733070687,
"description": "[CENTER][B][SIZE=7][IMG]https://i.imgur.com/ykHn9vx.png[/IMG] [/SIZE][/B]\n[SIZE=4][B]spark is a performance profiler for Minecraft clients, servers and proxies.[/B][/SIZE]\n[/CENTER]\n[B]Useful Links[/B]\n[LIST]\n[*][B][URL='https://spark.lucko.me/']Website[/URL][/B] - browse the project homepage\n[*][B][URL='https://spark.lucko.me/docs']Documentation[/URL][/B] - read documentation and usage guides\n[*][B][URL='https://spark.lucko.me/download']Downloads[/URL][/B] - latest development builds\n[/LIST]\n[B][SIZE=5]What does it do?[/SIZE][/B]\nspark is made up of a number of components, each detailed separately below.\n[LIST]\n[*][B]CPU Profiler[/B]: Diagnose performance issues.\n[*][B]Memory Inspection[/B]: Diagnose memory issues.\n[*][B]Server Health Reporting[/B]: Keep track of overall server health.\n[/LIST]\n\n[B][SIZE=6]⚡ CPU Profiler[/SIZE][/B]\nspark's profiler can be used to diagnose performance issues: \"lag\", low tick rate, high CPU usage, etc.\n\nIt is:\n[LIST]\n[*][B]Lightweight[/B] - can be ran in production with minimal impact.\n[*][B]Easy to use[/B] - no configuration or setup necessary, just install the plugin/mod.\n[*][B]Quick to produce results[/B] - running for just ~30 seconds is enough to produce useful insights into problematic areas for performance.\n[*][B]Customisable[/B] - can be tuned to target specific threads, sample at a specific interval, record only \"laggy\" periods, etc\n[*][B]Highly readable[/B] - simple tree structure lends itself to easy analysis and interpretation. The viewer can also apply deobfuscation mappings.\n[/LIST]\nIt works by sampling statistical data about the systems activity, and constructing a call graph based on this data. The call graph is then displayed in an online viewer for further analysis by the user.\n\nThere are two different profiler engines:\n[LIST]\n[*]Native [ICODE]AsyncGetCallTrace[/ICODE] + [ICODE]perf_events[/ICODE] - uses [URL='https://github.com/jvm-profiling-tools/async-profiler']async-profiler[/URL] ([I]only available on Linux x86_64 systems[/I])\n[*]Built-in Java [ICODE]ThreadMXBean[/ICODE] - an improved version of the popular [URL='https://github.com/sk89q/WarmRoast']WarmRoast profiler[/URL] by sk89q.\n[/LIST]\n[B]\n[SIZE=6]⚡ Memory Inspection[/SIZE][/B]\nspark includes a number of tools which are useful for diagnosing memory issues with a server.\n[LIST]\n[*][B]Heap Summary[/B] - take & analyse a basic snapshot of the servers memory\n[LIST]\n[*]A simple view of the JVM's heap, see memory usage and instance counts for each class\n[*]Not intended to be a full replacement of proper memory analysis tools. (see below)\n[/LIST]\n[/LIST]\n[LIST]\n[*][B]Heap Dump[/B] - take a full (HPROF) snapshot of the servers memory\n[LIST]\n[*]Dumps (& optionally compresses) a full snapshot of JVM's heap.\n[*]This snapshot can then be inspected using conventional analysis tools.\n[/LIST]\n[/LIST]\n[LIST]\n[*][B]GC Monitoring[/B] - monitor garbage collection activity on the server\n[LIST]\n[*]Allows the user to relate GC activity to game server hangs, and easily see how long they are taking & how much memory is being free'd.\n[*]Observe frequency/duration of young/old generation garbage collections to inform which GC tuning flags to use\n[/LIST]\n[/LIST]\n[B][SIZE=6]⚡ Server Health Reporting[/SIZE][/B]\nspark can report a number of metrics summarising the servers overall health.\n\nThese metrics include:\n[LIST]\n[*][B]TPS[/B] - ticks per second, to a more accurate degree indicated by the /tps command\n[*][B]Tick Durations[/B] - how long each tick is taking (min, max and average)\n[*][B]CPU Usage[/B] - how much of the CPU is being used by the server process, and by the overall system\n[*][B]Memory Usage[/B] - how much memory is being used by the process\n[*][B]Disk Usage[/B] - how much disk space is free/being used by the system\n[/LIST]\nAs well as providing tick rate averages, spark can also monitor individual ticks - sending a report whenever a single tick's duration exceeds a certain threshold. This can be used to identify trends and the nature of performance issues, relative to other system or game events.\n\n\n[SIZE=5][B]Us[SIZE=5]a[/SIZE]ge[/B][/SIZE]\nTo install, just add the [B]spark.jar[/B] file to your servers plugins directory.\n\nInformation about [URL='https://spark.lucko.me/docs/Command-Usage']how to use commands[/URL] can be found in the docs.\n\nIf you’d like help analysing a profiling report, or just want to chat, feel free to join us on [URL='https://discord.gg/PAGT2fu']Discord[/URL].\n\n\n[B][SIZE=5]Guides[/SIZE][/B]\nThere are a few small \"guides\" available in the docs, covering the following topics.\n[LIST]\n[*][URL='https://spark.lucko.me/docs/guides/The-tick-loop']The tick loop[/URL]\n[*][URL='https://spark.lucko.me/docs/guides/Finding-lag-spikes']Finding the cause of lag spikes[/URL]\n[/LIST]"
}
"description": "[CENTER][B][SIZE=7][IMG]https://i.imgur.com/ykHn9vx.png[/IMG] [/SIZE][/B]\n[SIZE=4][B]spark is a performance profiler for Minecraft clients, servers and proxies.[/B][/SIZE]\n[/CENTER]\n[B]Useful Links[/B]\n[LIST]\n[*][B][URL='https://spark.lucko.me/']Website[/URL][/B] - browse the project homepage\n[*][B][URL='https://spark.lucko.me/docs']Documentation[/URL][/B] - read documentation and usage guides\n[*][B][URL='https://spark.lucko.me/download']Downloads[/URL][/B] - latest development builds\n[/LIST]\n[B][SIZE=5]What does it do?[/SIZE][/B]\nspark is made up of a number of components, each detailed separately below.\n[LIST]\n[*][B]CPU Profiler[/B]: Diagnose performance issues.\n[*][B]Memory Inspection[/B]: Diagnose memory issues.\n[*][B]Server Health Reporting[/B]: Keep track of overall server health.\n[/LIST]\n\n[B][SIZE=6]⚡ CPU Profiler[/SIZE][/B]\nspark's profiler can be used to diagnose performance issues: \"lag\", low tick rate, high CPU usage, etc.\n\nIt is:\n[LIST]\n[*][B]Lightweight[/B] - can be ran in production with minimal impact.\n[*][B]Easy to use[/B] - no configuration or setup necessary, just install the plugin/mod.\n[*][B]Quick to produce results[/B] - running for just ~30 seconds is enough to produce useful insights into problematic areas for performance.\n[*][B]Customisable[/B] - can be tuned to target specific threads, sample at a specific interval, record only \"laggy\" periods, etc\n[*][B]Highly readable[/B] - simple tree structure lends itself to easy analysis and interpretation. The viewer can also apply deobfuscation mappings.\n[/LIST]\nIt works by sampling statistical data about the systems activity, and constructing a call graph based on this data. The call graph is then displayed in an online viewer for further analysis by the user.\n\nThere are two different profiler engines:\n[LIST]\n[*]Native [ICODE]AsyncGetCallTrace[/ICODE] + [ICODE]perf_events[/ICODE] - uses [URL='https://github.com/jvm-profiling-tools/async-profiler']async-profiler[/URL] ([I]only available on Linux x86_64 systems[/I])\n[*]Built-in Java [ICODE]ThreadMXBean[/ICODE] - an improved version of the popular [URL='https://github.com/sk89q/WarmRoast']WarmRoast profiler[/URL] by sk89q.\n[/LIST]\n[B]\n[SIZE=6]⚡ Memory Inspection[/SIZE][/B]\nspark includes a number of tools which are useful for diagnosing memory issues with a server.\n[LIST]\n[*][B]Heap Summary[/B] - take & analyse a basic snapshot of the servers memory\n[LIST]\n[*]A simple view of the JVM's heap, see memory usage and instance counts for each class\n[*]Not intended to be a full replacement of proper memory analysis tools. (see below)\n[/LIST]\n[/LIST]\n[LIST]\n[*][B]Heap Dump[/B] - take a full (HPROF) snapshot of the servers memory\n[LIST]\n[*]Dumps (& optionally compresses) a full snapshot of JVM's heap.\n[*]This snapshot can then be inspected using conventional analysis tools.\n[/LIST]\n[/LIST]\n[LIST]\n[*][B]GC Monitoring[/B] - monitor garbage collection activity on the server\n[LIST]\n[*]Allows the user to relate GC activity to game server hangs, and easily see how long they are taking & how much memory is being free'd.\n[*]Observe frequency/duration of young/old generation garbage collections to inform which GC tuning flags to use\n[/LIST]\n[/LIST]\n[B][SIZE=6]⚡ Server Health Reporting[/SIZE][/B]\nspark can report a number of metrics summarising the servers overall health.\n\nThese metrics include:\n[LIST]\n[*][B]TPS[/B] - ticks per second, to a more accurate degree indicated by the /tps command\n[*][B]Tick Durations[/B] - how long each tick is taking (min, max and average)\n[*][B]CPU Usage[/B] - how much of the CPU is being used by the server process, and by the overall system\n[*][B]Memory Usage[/B] - how much memory is being used by the process\n[*][B]Disk Usage[/B] - how much disk space is free/being used by the system\n[/LIST]\nAs well as providing tick rate averages, spark can also monitor individual ticks - sending a report whenever a single tick's duration exceeds a certain threshold. This can be used to identify trends and the nature of performance issues, relative to other system or game events.\n\n\n[SIZE=5][B]Us[SIZE=5]a[/SIZE]ge[/B][/SIZE]\nTo install, just add the [B]spark.jar[/B] file to your servers plugins directory.\n\nInformation about [URL='https://spark.lucko.me/docs/Command-Usage']how to use commands[/URL] can be found in the docs.\n\nIf you’d like help analysing a profiling report, or just want to chat, feel free to join us on [URL='https://discord.gg/PAGT2fu']Discord[/URL].\n\n\n[B][SIZE=5]Guides[/SIZE][/B]\nThere are a few small \"guides\" available in the docs, covering the following topics.\n[LIST]\n[*][URL='https://spark.lucko.me/docs/guides/The-tick-loop']The tick loop[/URL]\n[*][URL='https://spark.lucko.me/docs/guides/Finding-lag-spikes']Finding the cause of lag spikes[/URL]\n[/LIST]",
"source_code_url": "https://github.com/lucko/spark",
"donate_url": ""
}
Loading