Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add trace API test script

  • Loading branch information...
commit 2ab948df5274bf1fdda3d5bdbdd24b400c0d3f7b 1 parent 0080e8d
@nakagami authored
Showing with 38 additions and 0 deletions.
  1. +38 −0 misc/trace.py
View
38 misc/trace.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+##############################################################################
+# Copyright (c) 2011 Hajime Nakagami<nakagami@gmail.com>
+# All rights reserved.
+# Licensed under the New BSD License
+# (http://www.freebsd.org/copyright/freebsd-license.html)
+#
+# Python DB-API 2.0 module for Firebird.
+##############################################################################
+import os,sys
+sys.path.append('./../')
+import firebirdsql
+
+HOST = 'localhost'
+USER = 'sysdba'
+PASS = 'masterkey'
+
+def print_usage():
+ print(sys.argv[0] +
+ ' start|stop <trc_id>|suspend <trc_id>|resume <trc_id>|list')
+
+if len(sys.argv) < 2:
+ print_usage()
+ sys.exit(0)
+
+svc = firebirdsql.service_mgr(host=HOST, user=USER, password=PASS)
+if sys.argv[1] == 'start':
+ cfg = open('/opt/firebird/fbtrace.conf').read()
+ svc.trace_start(cfg=cfg, file=sys.stdout)
+elif sys.argv[1] == 'stop':
+ svc.trace_stop(id=sys.argv[2], file=sys.stdout)
+elif sys.argv[1] == 'suspend':
+ svc.trace_suspend(id=sys.argv[2], file=sys.stdout)
+elif sys.argv[1] == 'resume':
+ svc.trace_resume(id=sys.argv[2], file=sys.stdout)
+elif sys.argv[1] == 'list':
+ svc.trace_list()
+svc.close()
Please sign in to comment.
Something went wrong with that request. Please try again.