$extrastylesheet
Dakota  Version 6.2
Public Member Functions | Private Member Functions | Private Attributes
TrackerHTTP Class Reference

TrackerHTTP: a usage tracking module that uses HTTP/HTTPS via the curl library. More...

List of all members.

Public Member Functions

 TrackerHTTP ()
 default constructor is allowed, but doesn't generate output
 TrackerHTTP (int world_rank=0)
 standard constructor with ProblemDescDB, rank
 ~TrackerHTTP ()
 destructor to free handles
void post_start (ProblemDescDB &problem_db)
 post the start of an analysis and archive start time
void post_finish (unsigned runtime=0)
 post the completion of an analysis including elapsed time

Private Member Functions

void initialize (int world_rank=0)
 shared initialization functions across constructors
void url_add_field (std::string &url, const char *keyword, const std::string &value, bool delimit=true) const
 append keyword/value pair to url in GET style (with &keyword=value); set delimit = false to omit the &
void build_default_data (std::string &url, std::time_t &rawtime, const std::string &mode) const
 construct URL with shared information for start/finish
void send_data_using_get (const std::string &urltopost) const
 transmit data to the web server using GET
void send_data_using_post (const std::string &datatopost) const
 POST separate location and query; datatopost="name=daniel&project=curl".
void populate_method_list (ProblemDescDB &problem_db)
 extract list of methods from problem database
std::string get_uid () const
 get the real user ID
std::string get_username () const
 get the username as reported by the environment
std::string get_hostname () const
 get the system hostname
std::string get_os () const
 get the operating system
std::string get_datetime (const std::time_t &rawtime) const
 get the date and time as a string YYYYMMDDHHMMSS

Private Attributes

CURL * curlPtr
 pointer to the curl handler instance
FILE * devNull
 pointer to /dev/null
std::string trackerLocation
 base URL for the tracker
std::string proxyLocation
 if empty, proxy may still be specified via environment variables (unlike default CURL behavior)
long timeoutSeconds
 seconds until the request will timeout (may have issues with signals)
std::string methodList
 list of active methods
std::string dakotaVersion
 DAKOTA version.
std::time_t startTime
 cached starting time in raw seconds
short outputLevel
 verbosity control

Detailed Description

TrackerHTTP: a usage tracking module that uses HTTP/HTTPS via the curl library.


Member Function Documentation

void send_data_using_get ( const std::string &  urltopost) const [private]

transmit data to the web server using GET

whole url including location&fields

References TrackerHTTP::curlPtr, and TrackerHTTP::outputLevel.

void send_data_using_post ( const std::string &  datatopost) const [private]

POST separate location and query; datatopost="name=daniel&project=curl".

separate location and query; datatopost="name=daniel&project=curl"

References TrackerHTTP::curlPtr, TrackerHTTP::outputLevel, and TrackerHTTP::trackerLocation.

Referenced by TrackerHTTP::post_finish(), and TrackerHTTP::post_start().


The documentation for this class was generated from the following files: