[Git][debian-gis-team/tirex][master] 12 commits: Update branch in gbp.conf & Vcs-Git URL.
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Sun Aug 10 11:26:12 BST 2025
Bas Couwenberg pushed to branch master at Debian GIS Project / tirex
Commits:
7b8849a5 by Bas Couwenberg at 2025-08-02T16:12:13+02:00
Update branch in gbp.conf & Vcs-Git URL.
- - - - -
19b3b7c4 by Bas Couwenberg at 2025-08-02T16:12:50+02:00
New upstream version 0.8.0
- - - - -
08cfd372 by Bas Couwenberg at 2025-08-02T16:12:51+02:00
Update upstream source from tag 'upstream/0.8.0'
Update to upstream version '0.8.0'
with Debian dir 54f153bedbce40cdb145de5973e39bb9f7bffd71
- - - - -
3f668796 by Bas Couwenberg at 2025-08-02T16:13:05+02:00
New upstream release.
- - - - -
22f5c3cd by Bas Couwenberg at 2025-08-02T16:18:50+02:00
Refresh patches.
- - - - -
161ce757 by Bas Couwenberg at 2025-08-02T16:19:19+02:00
Set distribution to experimental.
- - - - -
e9cf1e29 by Bas Couwenberg at 2025-08-02T18:16:38+02:00
Repack upstream tarball to exclude GitLab CI configuration.
- - - - -
e67ae8d8 by Bas Couwenberg at 2025-08-02T18:16:40+02:00
New upstream version 0.8.0+ds
- - - - -
a5a0135c by Bas Couwenberg at 2025-08-02T18:16:41+02:00
Update upstream source from tag 'upstream/0.8.0+ds'
Update to upstream version '0.8.0+ds'
with Debian dir 6edb2c1a550f5ccf51b7dbd4e377d54fa4326baf
- - - - -
97acb82a by Bas Couwenberg at 2025-08-02T18:17:02+02:00
New repacked upstream release.
- - - - -
169b6901 by Bas Couwenberg at 2025-08-10T12:17:58+02:00
Revert "Update branch in gbp.conf & Vcs-Git URL."
This reverts commit 7b8849a554d8d553e20a8b70dd18338aedd9c4d2.
- - - - -
e108c523 by Bas Couwenberg at 2025-08-10T12:18:33+02:00
Move from experimental to unstable.
- - - - -
19 changed files:
- + .gitignore
- + CHANGELOG
- README.md
- + backend-mapnik/.gitignore
- backend-mapnik/Makefile
- backend-mapnik/metatilehandler.cc
- backend-mapnik/mortal.h
- backend-mapnik/networklistener.cc
- backend-mapnik/renderd.cc
- bin/tirex-backend-manager
- debian/changelog
- debian/copyright
- debian/patches/mapnik-4.0.patch
- debian/watch
- etc/renderer/mapnik.conf.dist
- example-map/example.xml
- lib/Tirex.pm
- lib/Tirex/Manager.pm
- t/rendering_basic.t
Changes:
=====================================
.gitignore
=====================================
@@ -0,0 +1,3 @@
+MYMETA.json
+MYMETA.yml
+Makefile.perl
=====================================
CHANGELOG
=====================================
@@ -0,0 +1,164 @@
+tirex (0.8.0) unstable; urgency=medium
+
+ [ Frederik Ramm ]
+ * preliminary build for github HEAD
+
+ [ Amanda McCann ]
+ * If any map style fails to load, tirex-backend-manager server will fail, and
+ will only be restarted a few times
+ * Ensure tirex stats are initialized to 0 not null cf issue #29
+ * Default master timeout raised from 10 to 60 minutes
+ * mapnik fontdir_recurse default changed to true
+ * Correct syntax in example map to match current mapnik API
+ * Cleanups to our debian packaging setup
+
+ -- Frederik Ramm <ramm at geofabrik.de> Thu, 19 May 2022 13:41:14 +0200
+
+tirex (0.7.0-1) unstable; urgency=medium
+
+ * Move from experimental to unstable.
+
+ -- Felix Delattre <debian at xama.nu> Mon, 22 Nov 2021 16:56:21 +0000
+
+tirex (0.7.0-1~exp1) experimental; urgency=medium
+
+ [ Felix Delattre ]
+ * Initial package (Closes: #968676).
+ * New upstream release 0.7.0
+ * Adjusted copyright information.
+ * Use tirex package.
+ * Sort and review dependencies.
+ * Review section declaration of packages.
+ * Place apache2 config when installing tirex.
+ * Introduce dedicated user _tirex.
+ * Remove experimental backends, plugins, and example map from packaging.
+ * Load utils into /usr/share.
+ * Handle tiles and stats in cache directory.
+ * Use daemon under /run.
+ * Check on systemd service files.
+ * Revisit configuration.
+ * Bump Standards-Version to 4.6.0, no changes.
+
+ [ Bas Couwenberg ]
+ * Bump watch file version to 4.
+ * Bump Standards-Version to 4.5.1, no changes.
+ * Update watch file for GitHub URL changes.
+
+ -- Felix Delattre <debian at xama.nu> Thu, 07 Oct 2021 14:37:41 +0000
+
+tirex (0.6.4) focal; urgency=medium
+
+ * allow adding a dot and zoom level after mapfile parameter to override map file for specific zoom levels
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Fri, 13 Aug 2021 11:55:10 +0200
+
+tirex (0.6.3) bionic; urgency=medium
+
+ * modify TMS backend to take template URL parameter
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Mon, 29 Jun 2020 15:57:07 +0200
+
+tirex (0.6.2) bionic; urgency=medium
+
+ * add TMS backend
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Wed, 21 Aug 2019 16:10:48 +0200
+
+tirex (0.6.1) bionic; urgency=medium
+
+ * add openseamap backend
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Wed, 21 Aug 2019 16:10:48 +0200
+
+tirex (0.6.0) bionic; urgency=medium
+
+ * tirex-syncd to use ssh master, also allow multiple destinations
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Sat, 02 Mar 2019 14:23:23 +0000
+
+tirex (0.5.2) bionic; urgency=medium
+
+ * die after serving X requests
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Mon, 14 Dec 2015 20:06:23 +0000
+
+tirex (0.5.1) bionic; urgency=medium
+
+ * jpeg tiles
+ * mapnik 3
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Mon, 14 Dec 2015 20:06:23 +0000
+
+tirex (0.4.1precise1) precise; urgency=low
+
+ * support (alomst) arbitrary sized meta tiles
+ * support for Mapnik2
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Tue, 26 Jun 2012 21:45:22 +0000
+
+tirex (0.3.1debian1) precise; urgency=low
+
+ * fix epsg3857 bug
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Tue, 08 May 2012 20:27:04 +0000
+
+tirex (0.3.0) jaunty; urgency=low
+
+ * add mapserver backend
+
+ -- Sven Geggus <sven-osm at geggus.net> Fri, 03 Feb 2012 19:43:24 +0100
+
+tirex (0.2.0) jaunty; urgency=low
+
+ * new renderd architecture allows several different renderers at the same time
+ * lots of other small improvements
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Mon, 3 May 2010 10:30:44 +0100
+
+tirex (0.1.7) jaunty; urgency=low
+
+ * bugfixes on zoom level 1+2
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Mon, 15 Mar 2010 21:48:44 +0100
+
+tirex (0.1.6) jaunty; urgency=low
+
+ * munin plugin overhaul
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Fri, 26 Feb 2010 22:38:03 +0100
+
+tirex (0.1.5) jaunty; urgency=low
+
+ * new commands to stop/continue buckets
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Wed, 24 Feb 2010 15:03:40 +0100
+
+tirex (0.1.4) jaunty; urgency=low
+
+ * new features+utilities, manpages
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Thu, 18 Feb 2010 12:02:16 +0100
+
+tirex (0.1.3) jaunty; urgency=low
+
+ * lots of new features
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Mon, 15 Feb 2010 19:17:53 +0100
+
+tirex (0.1.2) jaunty; urgency=low
+
+ * fixed renderd starter dying
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Wed, 10 Feb 2010 17:15:52 +0100
+
+tirex (0.1.1) jaunty; urgency=low
+
+ * new build
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Wed, 10 Feb 2010 11:40:21 +0100
+
+tirex (0.1) unstable; urgency=low
+
+ * Initial release.
+
+ -- Frederik Ramm <frederik.ramm at geofabrik.de> Thu, 04 Feb 2010 00:57:52 +0100
=====================================
README.md
=====================================
@@ -59,16 +59,15 @@ to create the packages. The following packages will be created in the parent
directory:
tirex
- tirex-backend-mapnik
- tirex-backend-wms
- tirex-backend-mapserver
- tirex-example-map
- tirex-munin-plugin
- tirex-nagios-plugin
- tirex-syncd
Call 'make deb-clean' to cleanup after a 'make deb'.
+This package is also maintained in Debian by the [Debian GIS Team](https://wiki.debian.org/Teams/DebianGis).
+
+ * [Debian packages](https://packages.debian.org/search?keywords=tirex)
+ * [Ubuntu packages](https://packages.ubuntu.com/search?keywords=tirex)
+ * [Debian Salsa/git packaging repo](https://salsa.debian.org/debian-gis-team/tirex)
+
## TESTS
Call 'prove' in the main directory to run Perl unit tests. You need Test::More
=====================================
backend-mapnik/.gitignore
=====================================
@@ -0,0 +1 @@
+*.o
=====================================
backend-mapnik/Makefile
=====================================
@@ -2,7 +2,7 @@ INSTALLOPTS=-g root -o root
CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
CXXFLAGS = `mapnik-config --cflags` $(CFLAGS)
CXXFLAGS += -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wold-style-cast
-LDFLAGS= `mapnik-config --libs --ldflags --dep-libs`
+LDFLAGS= `mapnik-config --libs --ldflags --dep-libs` -lboost_filesystem
backend-mapnik: renderd.o metatilehandler.o networklistener.o networkmessage.o networkrequest.o networkresponse.o debuggable.o requesthandler.o
$(CXX) -o $@ $^ $(LDFLAGS)
=====================================
backend-mapnik/metatilehandler.cc
=====================================
@@ -25,7 +25,12 @@
#include <mapnik/agg_renderer.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/load_map.hpp>
+
+#if MAPNIK_VERSION >= 400000
+#include <mapnik/geometry/box2d.hpp>
+#else
#include <mapnik/box2d.hpp>
+#endif
#if MAPNIK_VERSION >= 300000
# include <mapnik/datasource.hpp>
@@ -178,8 +183,8 @@ const NetworkResponse *MetatileHandler::handleRequest(const NetworkRequest *requ
return NetworkResponse::makeErrorResponse(request, "renderer internal error");
}
- char tmpfilename[PATH_MAX];
- snprintf(tmpfilename, PATH_MAX, "%s.%d.tmp", metafilename, getpid());
+ std::string tmpfilename = metafilename;
+ tmpfilename += "." + std::to_string(getpid()) + ".tmp";
std::ofstream outfile(tmpfilename, std::ios::out | std::ios::binary | std::ios::trunc);
outfile.write(reinterpret_cast<const char*>(&m), sizeof(m));
@@ -223,11 +228,11 @@ const NetworkResponse *MetatileHandler::handleRequest(const NetworkRequest *requ
if (outfile.fail())
{
- unlink(tmpfilename);
+ unlink(tmpfilename.c_str());
return NetworkResponse::makeErrorResponse(request, "cannot write metatile");
}
- rename(tmpfilename, metafilename);
+ rename(tmpfilename.c_str(), metafilename);
debug("created %s", metafilename);
resp = new NetworkResponse(request);
=====================================
backend-mapnik/mortal.h
=====================================
@@ -26,7 +26,7 @@ class Mortal
{
protected:
- void die(const char *fmt, ...)
+ void die(int exitcode, const char *fmt, ...)
{
char *cpy = static_cast<char *>(malloc(strlen(fmt) + 256));
sprintf(cpy, "%s\n", fmt);
@@ -34,7 +34,7 @@ class Mortal
va_start(ap, fmt);
vfprintf(stderr, cpy, ap);
va_end(ap);
- exit(1);
+ exit(exitcode);
}
};
=====================================
backend-mapnik/networklistener.cc
=====================================
@@ -64,7 +64,7 @@ NetworkListener::NetworkListener(int port, int sockfd, int parentfd, std::map<st
else
{
mSocket = socket(AF_INET, SOCK_DGRAM, 0);
- if (mSocket < 0) die ("cannot open socket: %s", strerror(errno));
+ if (mSocket < 0) die (2, "cannot open socket: %s", strerror(errno));
int one = 1;
setsockopt(mSocket, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(int));
length = sizeof(server);
@@ -72,7 +72,7 @@ NetworkListener::NetworkListener(int port, int sockfd, int parentfd, std::map<st
server.sin_family = AF_INET;
server.sin_addr.s_addr = inet_addr("127.0.0.1");
server.sin_port = htons(port);
- if (bind(mSocket, reinterpret_cast<sockaddr *>(&server), length) < 0) die("cannot bind to port %d: %s", port, strerror(errno));
+ if (bind(mSocket, reinterpret_cast<sockaddr *>(&server), length) < 0) die(2, "cannot bind to port %d: %s", port, strerror(errno));
debug("bound to port %d", port);
}
}
=====================================
backend-mapnik/renderd.cc
=====================================
@@ -205,7 +205,7 @@ RenderDaemon::RenderDaemon(int argc, char **argv) :
else if (strfac == "daemon") fac = LOG_DAEMON;
else
{
- die("Cannot use log facility '%s' - only local0-local7, user, daemon are allowed.", strfac.c_str());
+ die(2, "Cannot use log facility '%s' - only local0-local7, user, daemon are allowed.", strfac.c_str());
}
openlog("tirex-backend-mapnik", Debuggable::msDebugLogging ? LOG_PERROR|LOG_PID : LOG_PID, fac);
info("Renderer started (name=%s)", getenv("TIREX_BACKEND_NAME"));
@@ -227,7 +227,7 @@ RenderDaemon::RenderDaemon(int argc, char **argv) :
#endif
tmp = getenv("TIREX_BACKEND_CFG_fontdir_recurse");
- bool fr = tmp ? atoi(tmp) : false;
+ bool fr = tmp ? atoi(tmp) : true;
tmp = getenv("TIREX_BACKEND_CFG_fontdir");
if (tmp) loadFonts(tmp, fr);
@@ -238,13 +238,15 @@ RenderDaemon::RenderDaemon(int argc, char **argv) :
char *tkn = strtok(dup, " ");
while (tkn)
{
- loadMapnikWrapper(tkn);
+ if (!loadMapnikWrapper(tkn)) {
+ die(2, "Unable to load map");
+ }
tkn = strtok(NULL, " ");
}
}
if (mHandlerMap.empty())
- die("Cannot load any Mapnik styles");
+ die(2, "Cannot load any Mapnik styles");
}
=====================================
bin/tirex-backend-manager
=====================================
@@ -55,7 +55,7 @@ die("refusing to run as root\n") if ($< == 0);
my @argv = @ARGV;
my %opts = ();
-GetOptions( \%opts, 'help|h', 'debug|d', 'foreground|f', 'config|c=s' ) or exit(2);
+GetOptions( \%opts, 'help|h', 'debug|d', 'foreground|f', 'config|c=s' ) or exit($Tirex::EXIT_CODE_INVALIDARGUMENT);
if ($opts{'help'})
{
@@ -375,7 +375,7 @@ sub cleanup_dead_workers
{
my $renderer = $workers->{$pid}->{'renderer'};
syslog('err', 'terminating due to unexpected error in renderer %s', $renderer->get_name());
- exit_gracefully(2);
+ exit_gracefully($Tirex::EXIT_CODE_INVALIDARGUMENT);
}
$workers->{$pid}->{'handle'}->close();
=====================================
debian/changelog
=====================================
@@ -1,10 +1,20 @@
-tirex (0.7.1-4) UNRELEASED; urgency=medium
+tirex (0.8.0+ds-1) unstable; urgency=medium
* Team upload.
+ * Repack upstream tarball to exclude GitLab CI configuration.
+ * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org> Sun, 10 Aug 2025 12:18:19 +0200
+
+tirex (0.8.0-1~exp1) experimental; urgency=medium
+
+ * Team upload.
+ * New upstream release.
* Bump Standards-Version to 4.7.2, no changes.
* Fix old FSF address in copyright file.
+ * Refresh patches.
- -- Bas Couwenberg <sebastic at debian.org> Sun, 28 Jul 2024 20:05:42 +0200
+ -- Bas Couwenberg <sebastic at debian.org> Sat, 02 Aug 2025 16:19:03 +0200
tirex (0.7.1-3) unstable; urgency=medium
=====================================
debian/copyright
=====================================
@@ -2,6 +2,9 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Tirex
Upstream-Contact: Frederik Ramm <frederik.ramm at geofabrik.de>
Source: https://github.com/openstreetmap/tirex
+Comment: GitLab CI configuration is excluded to not trigger Salsa CI
+ for ther upstream branch.
+Files-Excluded: debian/.gitlab-ci.yml
Files: *
Copyright: 2010, 2019-2020, Frederik Ramm <frederik.ramm at geofabrik.de>
=====================================
debian/patches/mapnik-4.0.patch
=====================================
@@ -10,19 +10,8 @@ Forwarded: https://github.com/openstreetmap/tirex/issues/60
-CXXFLAGS = `mapnik-config --cflags` $(CFLAGS)
+CXXFLAGS += `pkg-config --cflags libmapnik` -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
CXXFLAGS += -Wall -Wextra -pedantic -Wredundant-decls -Wdisabled-optimization -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wold-style-cast
--LDFLAGS= `mapnik-config --libs --ldflags --dep-libs`
+-LDFLAGS= `mapnik-config --libs --ldflags --dep-libs` -lboost_filesystem
+LDFLAGS += `pkg-config --libs libmapnik` -lboost_filesystem
backend-mapnik: renderd.o metatilehandler.o networklistener.o networkmessage.o networkrequest.o networkresponse.o debuggable.o requesthandler.o
$(CXX) -o $@ $^ $(LDFLAGS)
---- a/backend-mapnik/metatilehandler.cc
-+++ b/backend-mapnik/metatilehandler.cc
-@@ -25,7 +25,7 @@
- #include <mapnik/agg_renderer.hpp>
- #include <mapnik/image_util.hpp>
- #include <mapnik/load_map.hpp>
--#include <mapnik/box2d.hpp>
-+#include <mapnik/geometry/box2d.hpp>
-
- #if MAPNIK_VERSION >= 300000
- # include <mapnik/datasource.hpp>
=====================================
debian/watch
=====================================
@@ -2,6 +2,7 @@ version=4
opts=\
dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$//,\
uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/;s/RC/rc/;s/\-/\./g,\
-filenamemangle=s/(?:.*?)?(?:rel|v|tirex)?[\-\_]?(\d\S+)\.(tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))/tirex-$1.$2/ \
+filenamemangle=s/(?:.*?)?(?:rel|v|tirex)?[\-\_]?(\d\S+)\.(tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))/tirex-$1.$2/,\
+repacksuffix=+ds \
https://github.com/openstreetmap/tirex/tags \
(?:.*?/archive/(?:.*?/)?)?(?:rel|v|tirex)?[\-\_]?(\d\S+)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
=====================================
etc/renderer/mapnik.conf.dist
=====================================
@@ -42,8 +42,8 @@ plugindir=/usr/lib/mapnik/3.0/input
# throw an exception.
fontdir=/usr/lib/mapnik/fonts
-# Set this to 1 if you want fonts loaded recursively from directories
-# inside the mapnik_fontdir directory. Defaults to 0.
-#fontdir_recurse=0
+# Set this to 0 if you don't want fonts loaded recursively from directories
+# inside the mapnik_fontdir directory. Defaults to 1, meaning do recurse.
+#fontdir_recurse=1
#-- THE END ------------------------------------------------------------------
=====================================
example-map/example.xml
=====================================
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
-<Map bgcolor="#eeebe2" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
+<Map background-color="#eeebe2" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
<Style name="ocean">
<Rule>
- <PolygonSymbolizer>
- <CssParameter name="fill">#b1d2f5</CssParameter>
- </PolygonSymbolizer>
+ <PolygonSymbolizer fill="#b1d2f5" />
</Rule>
</Style>
<Layer name="ocean" status="on" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
=====================================
lib/Tirex.pm
=====================================
@@ -44,6 +44,7 @@ our $MAX_PACKET_SIZE = 512;
# max zoom level we will ever allow
our $MAX_ZOOM = 30;
+our $EXIT_CODE_INVALIDARGUMENT = 2;
our $EXIT_CODE_RESTART = 9;
our $EXIT_CODE_DISABLE = 10;
@@ -65,11 +66,11 @@ our $SOCKET_DIR = '/run/tirex';
our $MASTER_SYSLOG_FACILITY = 'daemon';
our $MASTER_PIDFILE = '/run/tirex/tirex-master.pid';
our $MASTER_LOGFILE = '/var/log/tirex/jobs.log';
-our $MASTER_RENDERING_TIMEOUT = 10; # minutes
+our $MASTER_RENDERING_TIMEOUT = 60; # minutes
our $BACKEND_MANAGER_SYSLOG_FACILITY = 'daemon';
our $BACKEND_MANAGER_PIDFILE = '/run/tirex/tirex-backend-manager.pid';
-our $BACKEND_MANAGER_ALIVE_TIMEOUT = 8; # minutes - make this a tad smaller than the above
+our $BACKEND_MANAGER_ALIVE_TIMEOUT = 59; # minutes - make this a tad smaller than the above
our $SYNCD_PIDFILE = '/run/tirex/tirex-syncd.pid';
our $SYNCD_UDP_PORT = 9323;
=====================================
lib/Tirex/Manager.pm
=====================================
@@ -11,6 +11,7 @@ use Carp;
use IO::Socket::INET;
use Tirex;
+use Tirex::Map;
use Tirex::Manager::Bucket;
use Tirex::Manager::RenderingJobs;
@@ -297,11 +298,19 @@ sub done
::syslog('debug', 'job rendering done id=%s map=%s x=%d y=%d z=%d', $job->get_id(), $job->get_map(), $job->get_x(), $job->get_y(), $job->get_z()) if ($Tirex::DEBUG);
# update statistics
- $self->{'stats'}->{'count_rendered' }->{$job->get_map()}->[$job->get_z()] ||= 0;
+
+ if (!defined($self->{'stats'}->{'count_rendered'}->{$job->get_map()})) {
+ # initialize stats with zeroes for this map style
+ # Otherwise there are nulls in status JSON cf. https://github.com/openstreetmap/tirex/issues/29
+ my $maxz = Tirex::Map->get($job->get_map())->get_maxz();
+ foreach my $stat_name ( 'count_rendered', 'sum_render_time', 'max_render_time' ) {
+ my @zeroes = (0) x ($maxz + 1);
+ $self->{'stats'}->{$stat_name}->{$job->get_map()} = \@zeroes;
+ }
+ }
$self->{'stats'}->{'count_rendered' }->{$job->get_map()}->[$job->get_z()]++;
- $self->{'stats'}->{'sum_render_time'}->{$job->get_map()}->[$job->get_z()] ||= 0;
$self->{'stats'}->{'sum_render_time'}->{$job->get_map()}->[$job->get_z()] += $msg->{'render_time'};
- my $max = $self->{'stats'}->{'max_render_time'}->{$job->get_map()}->[$job->get_z()] || 0;
+ my $max = $self->{'stats'}->{'max_render_time'}->{$job->get_map()}->[$job->get_z()];
$max = $msg->{'render_time'} if $msg->{'render_time'} > $max;
$self->{'stats'}->{'max_render_time'}->{$job->get_map()}->[$job->get_z()] = $max;
=====================================
t/rendering_basic.t
=====================================
@@ -103,6 +103,7 @@ my $expected_status = {
count_error => 0,
count_rendered => {},
sum_render_time => {},
+ max_render_time => {},
},
};
my $is_status = $rm->status();
View it on GitLab: https://salsa.debian.org/debian-gis-team/tirex/-/compare/a42101b178c928b46f94843ed48972e696e786ae...e108c5230a46d5102e3fd74832480e5c620a94fb
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/tirex/-/compare/a42101b178c928b46f94843ed48972e696e786ae...e108c5230a46d5102e3fd74832480e5c620a94fb
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250810/608a4ec1/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list