Example #1
0
// About returns a chart of version identifiers for the DVID source code, DVID datastore, and
// all component data types for this executable.
func About() string {
	var text string = "\nCompile-time version information for this DVID executable:\n\n"
	writeLine := func(name dvid.TypeString, version string) {
		text += fmt.Sprintf("%-20s   %s\n", name, version)
	}
	writeLine("Name", "Version")
	writeLine("DVID Version", gitVersion)
	writeLine("Datastore Version", datastore.Version)
	text += "\n"
	writeLine("Storage engines", storage.EnginesAvailable())
	for _, t := range datastore.Compiled {
		writeLine(t.GetTypeName(), t.GetTypeVersion())
	}
	return text
}
Example #2
0
// AboutJSON returns a JSON string describing the properties of this server.
func AboutJSON() (jsonStr string, err error) {
	data := map[string]string{
		"Cores":             fmt.Sprintf("%d", dvid.NumCPU),
		"Maximum Cores":     fmt.Sprintf("%d", runtime.NumCPU()),
		"Datastore Version": datastore.Version,
		"DVID Version":      gitVersion,
		"Storage backend":   storage.EnginesAvailable(),
		"Server uptime":     time.Since(startupTime).String(),
	}
	m, err := json.Marshal(data)
	if err != nil {
		return
	}
	jsonStr = string(m)
	return
}