mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-08 21:47:17 +08:00
cicd: robot automated Change
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
0d5e57af04
commit
ac3a121f5c
@ -317,4 +317,4 @@ func main() {
|
|||||||
if failed {
|
if failed {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,4 +118,4 @@ func TestDedup(t *testing.T) {
|
|||||||
i, tc.input, out, tc.expected)
|
i, tc.input, out, tc.expected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -305,4 +305,4 @@ func upstreamLinkify(line string) string {
|
|||||||
return fmt.Sprintf("UPSTREAM: [%s#%s](https://github.com/%s/pull/%s):%s", m[1], m[2], m[1], m[2], m[3])
|
return fmt.Sprintf("UPSTREAM: [%s#%s](https://github.com/%s/pull/%s):%s", m[1], m[2], m[1], m[2], m[3])
|
||||||
}
|
}
|
||||||
return line
|
return line
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,8 +26,8 @@ import (
|
|||||||
|
|
||||||
// profiling configuration variables
|
// profiling configuration variables
|
||||||
var (
|
var (
|
||||||
profileName string = "none" // Name of the profile to capture.
|
profileName string = "none" // Name of the profile to capture.
|
||||||
profileOutput string = "profile.pprof" // File to write the profile data.
|
profileOutput string = "profile.pprof" // File to write the profile data.
|
||||||
)
|
)
|
||||||
|
|
||||||
// addProfilingFlags registers profiling related flags to the given FlagSet.
|
// addProfilingFlags registers profiling related flags to the given FlagSet.
|
||||||
@ -41,8 +41,8 @@ func addProfilingFlags(flags *pflag.FlagSet) {
|
|||||||
flags.StringVar(&profileOutput, "profile-output", "profile.pprof", "File to write the profile data")
|
flags.StringVar(&profileOutput, "profile-output", "profile.pprof", "File to write the profile data")
|
||||||
}
|
}
|
||||||
|
|
||||||
// initProfiling sets up profiling based on the user's choice.
|
// initProfiling sets up profiling based on the user's choice.
|
||||||
// If 'cpu' is selected, it starts the CPU profile. For block and mutex profiles,
|
// If 'cpu' is selected, it starts the CPU profile. For block and mutex profiles,
|
||||||
// sampling rates are set up.
|
// sampling rates are set up.
|
||||||
func initProfiling() error {
|
func initProfiling() error {
|
||||||
switch profileName {
|
switch profileName {
|
||||||
@ -55,10 +55,10 @@ func initProfiling() error {
|
|||||||
}
|
}
|
||||||
return pprof.StartCPUProfile(f)
|
return pprof.StartCPUProfile(f)
|
||||||
case "block":
|
case "block":
|
||||||
runtime.SetBlockProfileRate(1) // Sampling every block event
|
runtime.SetBlockProfileRate(1) // Sampling every block event
|
||||||
return nil
|
return nil
|
||||||
case "mutex":
|
case "mutex":
|
||||||
runtime.SetMutexProfileFraction(1) // Sampling every mutex event
|
runtime.SetMutexProfileFraction(1) // Sampling every mutex event
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
if profile := pprof.Lookup(profileName); profile == nil {
|
if profile := pprof.Lookup(profileName); profile == nil {
|
||||||
@ -68,8 +68,8 @@ func initProfiling() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// flushProfiling writes the profiling data to the specified file.
|
// flushProfiling writes the profiling data to the specified file.
|
||||||
// For heap profiles, it runs the GC before capturing the data.
|
// For heap profiles, it runs the GC before capturing the data.
|
||||||
// It stops the CPU profile if it was started.
|
// It stops the CPU profile if it was started.
|
||||||
func flushProfiling() error {
|
func flushProfiling() error {
|
||||||
switch profileName {
|
switch profileName {
|
||||||
|
|||||||
@ -69,4 +69,4 @@ func streamYaml(writer io.Writer, indent *int, in *yaml.Node) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return encoder.Close()
|
return encoder.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,12 +70,12 @@ func Test_fetchYaml(t *testing.T) {
|
|||||||
Tag: "!!map",
|
Tag: "!!map",
|
||||||
Value: "",
|
Value: "",
|
||||||
Content: []*yaml.Node{
|
Content: []*yaml.Node{
|
||||||
&yaml.Node{
|
{
|
||||||
Kind: yaml.ScalarNode,
|
Kind: yaml.ScalarNode,
|
||||||
Tag: "!!str",
|
Tag: "!!str",
|
||||||
Value: "key",
|
Value: "key",
|
||||||
},
|
},
|
||||||
&yaml.Node{
|
{
|
||||||
Kind: yaml.ScalarNode,
|
Kind: yaml.ScalarNode,
|
||||||
Tag: "!!str",
|
Tag: "!!str",
|
||||||
Value: "value",
|
Value: "value",
|
||||||
@ -126,12 +126,12 @@ func Test_streamYaml(t *testing.T) {
|
|||||||
Tag: "!!map",
|
Tag: "!!map",
|
||||||
Value: "",
|
Value: "",
|
||||||
Content: []*yaml.Node{
|
Content: []*yaml.Node{
|
||||||
&yaml.Node{
|
{
|
||||||
Kind: yaml.ScalarNode,
|
Kind: yaml.ScalarNode,
|
||||||
Tag: "!!str",
|
Tag: "!!str",
|
||||||
Value: "key",
|
Value: "key",
|
||||||
},
|
},
|
||||||
&yaml.Node{
|
{
|
||||||
Kind: yaml.ScalarNode,
|
Kind: yaml.ScalarNode,
|
||||||
Tag: "!!str",
|
Tag: "!!str",
|
||||||
Value: "value",
|
Value: "value",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user