mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
Add some metric history
The count of connections and count of delivered messages now have 50 minutes of history available in the /about sparklines.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package smtpd
|
||||
|
||||
import (
|
||||
"container/list"
|
||||
"crypto/sha1"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -25,3 +26,15 @@ func HashMailboxName(mailbox string) string {
|
||||
io.WriteString(h, mailbox)
|
||||
return fmt.Sprintf("%x", h.Sum(nil))
|
||||
}
|
||||
|
||||
// JoinStringList joins a List containing strings by commas
|
||||
func JoinStringList(listOfStrings *list.List) string {
|
||||
if listOfStrings.Len() == 0 {
|
||||
return ""
|
||||
}
|
||||
s := make([]string, 0, listOfStrings.Len())
|
||||
for e := listOfStrings.Front(); e != nil; e = e.Next() {
|
||||
s = append(s, e.Value.(string))
|
||||
}
|
||||
return strings.Join(s, ",")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user