[Xastir-dev] tiger map query time debug
Dan Brown
brown at brauhausdc.org
Mon Nov 22 21:25:37 EST 2004
On Mon, 22 Nov 2004, Dan Brown wrote:
>
>
> Here's some quick diffs to add in a timing debug for tiger.census.gov
> queries:
>
> http://www.brauhaus.org/~brown/xastir/map_tiger.c_diffs_20041122_query_time
>
Sorry for all the emails tonight - I'll try to bundle these up in the future,
if it is a problem.
Some new diffs at the same URL as above - works better if the query time
output it is outside the MAP_CACHE ifdef, etc:
--- xastir/src/map_tiger.c 2004-11-19 21:49:31.000000000 -0500
+++ xastir-n8ysz/src/map_tiger.c 2004-11-22 21:22:20.000000000 -0500
@@ -207,6 +207,8 @@
int geo_image_width; // Image width from GEO file
int geo_image_height; // Image height from GEO file
+ time_t query_start_time, query_end_time;
+
#ifdef USE_MAP_CACHE
int map_cache_return;
#endif // USE_MAP_CACHE
@@ -395,6 +397,9 @@
fprintf(stderr,"ftp or http file: %s\n", fileimg);
}
+ if (debug_level & 512) {
+ query_start_time=time(&query_start_time);
+ }
#ifdef USE_MAP_CACHE
@@ -507,7 +512,7 @@
// For debugging the MagickError/MagickWarning segfaults.
//system("cat /dev/null >/var/tmp/xastir_hacker_map.gif");
-
+
#ifdef USE_MAP_CACHE
map_cache_put(fileimg,local_filename);
@@ -515,6 +520,9 @@
} // end if is cached DHBROWN
#endif // MAP_CACHE
+ (debug_level & 512) && fprintf (stderr, "Query took %d seconds\n",
+ (int) (time(&query_end_time) - query_start_time));
+
// Set permissions on the file so that any user can overwrite it.
chmod(local_filename, 0666);
--
Dan Brown
brown at brauhausdc.org
More information about the Xastir-dev
mailing list