Ejemplo n.º 1
0
	client       http.Client
	broker       *sse.Broker
	baseURL      string
)

var format = flag.String([]string{"f", "-format"}, "Link", "Output format - Link/JSON/CDXJ")
var arcsloc = flag.String([]string{"a", "-arcs"}, "http://git.io/archives", "Local/remote JSON file path/URL for list of archives")
var logfile = flag.String([]string{"l", "-log"}, "", "Log file location - defaults to STDERR")
var benchmark = flag.String([]string{"b", "-benchmark"}, "", "Benchmark file location - Defaults to Logfile")
var contact = flag.String([]string{"c", "-contact"}, "@WebSciDL", "Email/URL/Twitter handle - used in the user-agent")
var agent = flag.String([]string{"A", "-agent"}, fmt.Sprintf("%s:%s <{CONTACT}>", Name, Version), "User-agent string sent to archives")
var host = flag.String([]string{"H", "-host"}, "localhost", "Host name - only used in web service mode")
var proxy = flag.String([]string{"P", "-proxy"}, "http://{HOST}[:{PORT}]{ROOT}", "Proxy URL - defaults to host, port, and root")
var root = flag.String([]string{"R", "-root"}, "/", "Service root path prefix")
var static = flag.String([]string{"D", "-static"}, "", "Directory path to serve static assets from")
var port = flag.Int([]string{"p", "-port"}, 1208, "Port number - only used in web service mode")
var topk = flag.Int([]string{"k", "-topk"}, -1, "Aggregate only top k archives based on probability")
var tolerance = flag.Int([]string{"F", "-tolerance"}, -1, "Failure tolerance limit for each archive")
var verbose = flag.Bool([]string{"V", "-verbose"}, false, "Show Info and Profiling messages on STDERR")
var version = flag.Bool([]string{"v", "-version"}, false, "Show name and version")
var spoof = flag.Bool([]string{"S", "-spoof"}, false, "Spoof each request with a random user-agent")
var monitor = flag.Bool([]string{"m", "-monitor"}, false, "Benchmark monitoring via SSE")
var contimeout = flag.Duration([]string{"t", "-contimeout"}, time.Duration(5*time.Second), "Connection timeout for each archive")
var hdrtimeout = flag.Duration([]string{"T", "-hdrtimeout"}, time.Duration(30*time.Second), "Header timeout for each archive")
var restimeout = flag.Duration([]string{"r", "-restimeout"}, time.Duration(60*time.Second), "Response timeout for each archive")
var dormant = flag.Duration([]string{"d", "-dormant"}, time.Duration(15*time.Minute), "Dormant period after consecutive failures")

// Session struct needs explanation, TODO
type Session struct {
	Start time.Time
}
Ejemplo n.º 2
0
	logProfile *log.Logger
	logInfo    *log.Logger
	logError   *log.Logger
)

var format = flag.String([]string{"f", "-format"}, "Link", "Output format - Link/JSON/CDXJ")
var arcsloc = flag.String([]string{"a", "-arcs"}, "http://oduwsdl.github.io/memgator/archives.json", "Local/remote JSON file path/URL for list of archives")
var logfile = flag.String([]string{"l", "-log"}, "", "Log file location - Defaults to STDERR")
var profile = flag.String([]string{"P", "-profile"}, "", "Profile file location - Defaults to Logfile")
var contact = flag.String([]string{"c", "-contact"}, "@WebSciDL", "Email/URL/Twitter handle - Used in the user-agent")
var agent = flag.String([]string{"A", "-agent"}, fmt.Sprintf("%s:%s <{CONTACT}>", Name, Version), "User-agent string sent to archives")
var host = flag.String([]string{"H", "-host"}, "localhost", "Host name - only used in web service mode")
var servicebase = flag.String([]string{"s", "-service"}, "http://{HOST}[:{PORT}]", "Service base URL - default based on host & port")
var mapbase = flag.String([]string{"m", "-timemap"}, "http://{SERVICE}/timemap", "TimeMap base URL - default based on service URL")
var gatebase = flag.String([]string{"g", "-timegate"}, "http://{SERVICE}/timegate", "TimeGate base URL - default based on service URL")
var port = flag.Int([]string{"p", "-port"}, 1208, "Port number - only used in web service mode")
var topk = flag.Int([]string{"k", "-topk"}, -1, "Aggregate only top k archives based on probability")
var verbose = flag.Bool([]string{"V", "-verbose"}, false, "Show Info and Profiling messages on STDERR")
var version = flag.Bool([]string{"v", "-version"}, false, "Show name and version")
var contimeout = flag.Duration([]string{"t", "-contimeout"}, time.Duration(5*time.Second), "Connection timeout for each archive")
var hdrtimeout = flag.Duration([]string{"T", "-hdrtimeout"}, time.Duration(15*time.Second), "Header timeout for each archive")
var restimeout = flag.Duration([]string{"r", "-restimeout"}, time.Duration(20*time.Second), "Response timeout for each archive")

type Session struct {
	Start time.Time
}

type Archive struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Timemap     string  `json:"timemap"`