vi er her !!!

02120

DifferentielGPS
home

Opslag

Kontrol af at databasen får tilsendt de rigtige kommandoer - især ved udtræk fra databasen - kan f.eks udføres live ved at kigge på proceslisten. En anden mulighed er at kigge i MySQLs logfiler, hvis disse er til stede.

Nedenstående er resultatet af hvad der sker på databaseserveren når man

  • opbygger interfacet
  • sender forespørgsler

for at exportere til regneark.

[root@hooper root]# mysqladmin --user=root --password=xxxx processlist
+-----+------------+--------------------------+------+---------+------+--------------+-------------------------------------------------------+
| Id  | User       | Host                     | db   | Command | Time | State        | Info                                                  |
+-----+------------+--------------------------+------+---------+------+--------------+-------------------------------------------------------+
| 914 | dGPSklient | dhcp141.imm.dtu.dk:49449 | dGPS | Query   | 38   | Sending data | select satelliteId from data group by satelliteId asc |
| 916 | root       | localhost                |      | Query   | 0    |              | show processlist                                      |
+-----+------------+--------------------------+------+---------+------+--------------+-------------------------------------------------------+
[root@hooper root]# mysqladmin --user=root --password=xxxx processlist
+-----+------------+--------------------------+------+---------+------+--------------+-----------------------------------------+
| Id  | User       | Host                     | db   | Command | Time | State        | Info                                    |
+-----+------------+--------------------------+------+---------+------+--------------+-----------------------------------------+
| 914 | dGPSklient | dhcp141.imm.dtu.dk:49449 | dGPS | Query   | 118  | Sending data | select device from data group by device |
| 924 | root       | localhost                |      | Query   | 0    |              | show processlist                        |
+-----+------------+--------------------------+------+---------+------+--------------+-----------------------------------------+
[root@hooper root]# mysqladmin --user=root --password=xxxx processlist
+-----+------------+--------------------------+------+---------+------+-------+------------------+
| Id  | User       | Host                     | db   | Command | Time | State | Info             |
+-----+------------+--------------------------+------+---------+------+-------+------------------+
| 914 | dGPSklient | dhcp141.imm.dtu.dk:49449 | dGPS | Sleep   | 2    |       |                  |
| 925 | root       | localhost                |      | Query   | 0    |       | show processlist |
+-----+------------+--------------------------+------+---------+------+-------+------------------+
[root@hooper root]# mysqladmin --user=root --password=xxxx processlist
+-----+------------+--------------------------+------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
| Id  | User       | Host                     | db   | Command | Time | State        | Info                                                                                                 |
+-----+------------+--------------------------+------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
| 914 | dGPSklient | dhcp141.imm.dtu.dk:49449 | dGPS | Query   | 7    | Sending data | select udre, satelliteId, pseudorangeC, rangeRateC, tidsstempel from data where ( satelliteId in ( 2 |
| 926 | root       | localhost                |      | Query   | 0    |              | show processlist                                                                                     |
+-----+------------+--------------------------+------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
[root@hooper root]# mysqladmin --user=root --password=xxxx processlist
+-----+------------+--------------------------+------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
| Id  | User       | Host                     | db   | Command | Time | State        | Info                                                                                                 |
+-----+------------+--------------------------+------+---------+------+--------------+------------------------------------------------------------------------------------------------------+
| 914 | dGPSklient | dhcp141.imm.dtu.dk:49449 | dGPS | Query   | 9    | Sending data | select udre from data where ( satelliteId in ( 23 )) and ( device in ( 'reference' )) and ( 11146051 |
| 927 | root       | localhost                |      | Query   | 0    |              | show processlist                                                                                     |
+-----+------------+--------------------------+------+---------+------+--------------+------------------------------------------------------------------------------------------------------+

Ud fra det foranstående kan man se følgede:

  • forbindelsen bliver genbrugt som ønsket da Id 914 er det samme for hver forespørgsel
  • forbindelsen bliver opretholdt, da der er en Sleep
  • under opbygningen af interfacet modtager databaseserveren de rigtige kommandoer
  • selve udtrækket har desværre så lang en kommando at man ikke kan se den hele i mange tilfælde men man kan alligevel få en god ide om at det er korrekte forspørgsler man sender

home