Changeset 935

Show
Ignore:
Timestamp:
12/28/06 00:00:18 (2 years ago)
Author:
ahu
Message:

implement 'rec_control get uptime' (suggested by Niels Bakker), implement --version in recursor

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pdns/pdns/docs/pdns.sgml

    r923 r935  
    13941394            <listitem> 
    13951395              <para> 
    1396                 Reported version can be changed, or removed - see the "version-string" setting. 
     1396                Reported version can be changed, or removed - see the "version-string" setting.  
    13971397              </para> 
    13981398            </listitem> 
     
    70017001          </varlistentry> 
    70027002          <varlistentry> 
     7003            <term>version</term> 
     7004            <listitem> 
     7005              <para> 
     7006                Print version of this binary. Useful for checking which version of the PowerDNS recursor is installed on a system. Available since 3.1.5. 
     7007              </para> 
     7008            </listitem> 
     7009          </varlistentry> 
     7010          <varlistentry> 
    70037011            <term>version-string</term> 
    70047012            <listitem> 
     
    72547262unauthorized-udp    number of UDP questions denied because of allow-from restrictions 
    72557263unexpected-packets  number of answers from remote servers that were unexpected (might point to spoofing) 
    7256 user-msec            number of CPU milliseconds spent in 'user' mode 
     7264uptime              number of seconds process has been running (since 3.1.5) 
     7265user-msec           number of CPU milliseconds spent in 'user' mode 
    72577266          </screen> 
    72587267        In the <filename>rrd/</filename> subdirectory a number of rrdtool scripts is provided to make nice 
  • trunk/pdns/pdns/pdns_recursor.cc

    r934 r935  
    17411741int main(int argc, char **argv)  
    17421742{ 
     1743  g_stats.startupTime=time(0); 
    17431744  reportBasicTypes(); 
    17441745 
     
    18071808 
    18081809    ::arg().setCmd("help","Provide a helpful message"); 
     1810    ::arg().setCmd("version","Print version string ("VERSION")"); 
    18091811    ::arg().setCmd("config","Output blank configuration"); 
    18101812    L.toConsole(Logger::Info); 
     
    18241826      cerr<<"syntax:"<<endl<<endl; 
    18251827      cerr<<::arg().helpstring(::arg()["help"])<<endl; 
     1828      exit(99); 
     1829    } 
     1830    if(::arg().mustDo("version")) { 
     1831      cerr<<"version: "VERSION<<endl; 
    18261832      exit(99); 
    18271833    } 
  • trunk/pdns/pdns/rec_channel_rec.cc

    r932 r935  
    135135#endif 
    136136 
     137static uint64_t calculateUptime() 
     138{ 
     139  return time(0) - g_stats.startupTime; 
     140} 
     141 
    137142static string doCurrentQueries() 
    138143{ 
     
    214219  addGetStat("chain-resends", &g_stats.chainResends); 
    215220 
     221  addGetStat("uptime", calculateUptime); 
     222 
    216223#ifndef WIN32 
    217224  //  addGetStat("query-rate", getQueryRate); 
  • trunk/pdns/pdns/syncres.hh

    r933 r935  
    480480  uint64_t shunted; 
    481481  uint64_t noShuntCNAME, noShuntExpired, noShuntSize, noShuntNoMatch, noShuntWrongType, noShuntWrongQuestion; 
    482  
     482  time_t startupTime; 
    483483 
    484484  typedef vector<ComboAddress> remotes_t;