You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: stat.go
    path of file: ./repos/tidb/pkg/server
    
    the code of the file until where you have to start completion: // Copyright 2021 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use 
    
func (s *Server) Stats(_ *variable.SessionVars) (map[string]any, error) {
	m := make(map[string]any, len(defaultStatus))

	for name, v := range defaultStatus {
		m[name] = v.Value
	}

	tlsConfig := s.GetTLSConfig()
	if tlsConfig != nil {
		if len(tlsConfig.Certificates) == 1 {
			pc, err := x509.ParseCertificate(tlsConfig.Certificates[0].Certificate[0])
			if err != nil {
				logutil.BgLogger().Error("Failed to parse TLS certficates to get server status", zap.Error(err))
			} else {
				m[serverNotAfter] = pc.NotAfter.Format("Jan _2 15:04:05 2006 MST")
				m[serverNotBefore] = pc.NotBefore.Format("Jan _2 15:04:05 2006 MST")
			}
		}
	}

	var err error
	info := tikvhandler.ServerInfo{}
	info.ServerInfo, err = infosync.GetServerInfo()
	if err != nil {
		logutil.BgLogger().Error("Failed to get ServerInfo for uptime status", zap.Error(err))
	} else {
		m[upTime] = int64(time.Since(time.Unix(info.ServerInfo.StartTimestamp, 0)).Seconds())
	}

	return m, nil
}