Skip to content
Permalink
Browse files

update

  • Loading branch information...
shaocongcong committed Apr 10, 2019
1 parent fc31e9c commit 23713567b2213fb1e0df6af27629ae8168982d7b
Showing with 87 additions and 288 deletions.
  1. +3 −2 .gitignore
  2. +2 −2 agent/cmd/root.go
  3. +1 −1 agent/main.go
  4. +2 −2 agent/service/agent.go
  5. +1 −1 agent/service/collector.go
  6. +1 −1 agent/service/etcd.go
  7. +3 −3 agent/service/network.go
  8. +7 −7 agent/service/pinpoint.go
  9. +1 −1 agent/service/sync.go
  10. +5 −5 agent/service/udp.go
  11. +2 −2 collector/cmd/root.go
  12. +1 −1 collector/main.go
  13. +4 −4 collector/service/app.go
  14. +1 −1 collector/service/apps.go
  15. +4 −5 collector/service/collector.go
  16. +1 −1 collector/service/etcd.go
  17. +3 −3 collector/service/network.go
  18. +6 −6 collector/service/pinpoint.go
  19. +4 −4 collector/service/stats.go
  20. +28 −29 collector/service/storage.go
  21. 0 pkg/{proto → }/network/agent_info.go
  22. 0 pkg/{proto → }/network/cmd.go
  23. 0 pkg/{proto → }/network/span_packet.go
  24. +1 −1 pkg/{proto → }/network/tcp.go
  25. 0 pkg/{proto → }/pinpoint/proto/application_request.go
  26. 0 pkg/{proto → }/pinpoint/proto/application_response.go
  27. 0 pkg/{proto → }/pinpoint/proto/application_send.go
  28. 0 pkg/{proto → }/pinpoint/proto/application_stream_close.go
  29. 0 pkg/{proto → }/pinpoint/proto/application_stream_create.go
  30. 0 pkg/{proto → }/pinpoint/proto/application_stream_create_fail.go
  31. 0 pkg/{proto → }/pinpoint/proto/application_stream_create_success.go
  32. 0 pkg/{proto → }/pinpoint/proto/application_stream_ping.go
  33. 0 pkg/{proto → }/pinpoint/proto/application_stream_pong.go
  34. 0 pkg/{proto → }/pinpoint/proto/application_stream_response.go
  35. 0 pkg/{proto → }/pinpoint/proto/control_client_close.go
  36. 0 pkg/{proto → }/pinpoint/proto/control_handshake.go
  37. 0 pkg/{proto → }/pinpoint/proto/control_handshake_response.go
  38. 0 pkg/{proto → }/pinpoint/proto/control_ping.go
  39. 0 pkg/{proto → }/pinpoint/proto/control_ping_payload.go
  40. 0 pkg/{proto → }/pinpoint/proto/control_pong.go
  41. +1 −1 pkg/{proto → }/pinpoint/proto/packet.go
  42. 0 pkg/{proto → }/pinpoint/thrift/Command.thrift
  43. 0 pkg/{proto → }/pinpoint/thrift/Flink.thrift
  44. 0 pkg/{proto → }/pinpoint/thrift/Pinpoint.thrift
  45. 0 pkg/{proto → }/pinpoint/thrift/Trace.thrift
  46. 0 pkg/{proto → }/pinpoint/thrift/command/Command-consts.go
  47. 0 pkg/{proto → }/pinpoint/thrift/command/Command.go
  48. 0 pkg/{proto → }/pinpoint/thrift/command/GoUnusedProtection__.go
  49. 0 pkg/{proto → }/pinpoint/thrift/deserialize.go
  50. 0 pkg/{proto → }/pinpoint/thrift/flink/Flink-consts.go
  51. 0 pkg/{proto → }/pinpoint/thrift/flink/Flink.go
  52. 0 pkg/{proto → }/pinpoint/thrift/flink/GoUnusedProtection__.go
  53. +3 −3 pkg/{proto → }/pinpoint/thrift/header.go
  54. 0 pkg/{proto → }/pinpoint/thrift/pinpoint/GoUnusedProtection__.go
  55. +1 −1 pkg/{proto → }/pinpoint/thrift/pinpoint/Pinpoint-consts.go
  56. +1 −1 pkg/{proto → }/pinpoint/thrift/pinpoint/Pinpoint.go
  57. 0 pkg/{proto → }/pinpoint/thrift/serialize.go
  58. 0 pkg/{proto → }/pinpoint/thrift/trace/GoUnusedProtection__.go
  59. 0 pkg/{proto → }/pinpoint/thrift/trace/Trace-consts.go
  60. 0 pkg/{proto → }/pinpoint/thrift/trace/Trace.go
  61. 0 pkg/{proto → }/sql/collector.go
  62. 0 pkg/{proto → }/stats/api_map.go
  63. 0 pkg/{proto → }/stats/api_stats.go
  64. 0 pkg/{proto → }/stats/exceptions_stats.go
  65. 0 pkg/{proto → }/stats/jvm_stats.go
  66. 0 pkg/{proto → }/stats/method_stats.go
  67. 0 pkg/{proto → }/stats/sql_stats.go
  68. 0 pkg/{proto → }/stats/srvmap_stats.go
  69. 0 pkg/{proto → }/stats/stats_info.go
  70. 0 pkg/{proto → }/stats/system_stats.go
  71. 0 pkg/{proto → }/ttype/srv_type.go
  72. 0 pkg/{proto → }/ttype/ttype.go
  73. +0 −200 test/main.go
@@ -1,6 +1,7 @@
.idea/
.bin/
tracing/tracing
agent/agent
analyze/analyze
collector/collector
alert/alert
web/web
.DS_Store
@@ -7,8 +7,8 @@ import (
"syscall"

"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/agent/misc"
"github.com/shaocongcong/tracing/agent/service"
"github.com/imdevlab/tracing/agent/misc"
"github.com/imdevlab/tracing/agent/service"
"github.com/spf13/cobra"
"go.uber.org/zap"
)
@@ -14,7 +14,7 @@

package main

import "github.com/shaocongcong/tracing/agent/cmd"
import "github.com/imdevlab/tracing/agent/cmd"

func main() {
cmd.Execute()
@@ -4,8 +4,8 @@ import (
"sync/atomic"
"time"

"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/shaocongcong/tracing/pkg/proto/ttype"
"github.com/imdevlab/tracing/pkg/network"
"github.com/imdevlab/tracing/pkg/ttype"
"github.com/vmihailenco/msgpack"

"github.com/imdevlab/g"
@@ -5,7 +5,7 @@ import (
"strings"
"sync"

"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/imdevlab/tracing/pkg/network"

"go.uber.org/zap"

@@ -4,7 +4,7 @@ import (
"context"
"time"

"github.com/shaocongcong/tracing/agent/misc"
"github.com/imdevlab/tracing/agent/misc"

"github.com/imdevlab/g"
"go.etcd.io/etcd/clientv3"
@@ -7,9 +7,9 @@ import (
"time"

"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/agent/misc"
"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/shaocongcong/tracing/pkg/proto/ttype"
"github.com/imdevlab/tracing/agent/misc"
"github.com/imdevlab/tracing/pkg/network"
"github.com/imdevlab/tracing/pkg/ttype"
"github.com/vmihailenco/msgpack"
"go.uber.org/zap"
)
@@ -10,13 +10,13 @@ import (
"time"

"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/agent/misc"
"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/proto"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/pinpoint"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/trace"
"github.com/shaocongcong/tracing/pkg/proto/ttype"
"github.com/imdevlab/tracing/agent/misc"
"github.com/imdevlab/tracing/pkg/network"
"github.com/imdevlab/tracing/pkg/pinpoint/proto"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/pinpoint"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/trace"
"github.com/imdevlab/tracing/pkg/ttype"
"github.com/vmihailenco/msgpack"
"go.uber.org/zap"
)
@@ -6,7 +6,7 @@ import (
"time"

"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/imdevlab/tracing/pkg/network"
"go.uber.org/zap"
)

@@ -3,13 +3,13 @@ package service
import (
"fmt"

"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/shaocongcong/tracing/pkg/proto/ttype"
"github.com/imdevlab/tracing/pkg/network"
"github.com/imdevlab/tracing/pkg/ttype"

"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/pinpoint"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/trace"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/pinpoint"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/trace"
"go.uber.org/zap"
)

@@ -21,8 +21,8 @@ import (
"syscall"

"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/collector/misc"
"github.com/shaocongcong/tracing/collector/service"
"github.com/imdevlab/tracing/collector/misc"
"github.com/imdevlab/tracing/collector/service"
"github.com/spf13/cobra"
"go.uber.org/zap"
)
@@ -14,7 +14,7 @@

package main

import "github.com/shaocongcong/tracing/collector/cmd"
import "github.com/imdevlab/tracing/collector/cmd"

func main() {
cmd.Execute()
@@ -10,10 +10,10 @@ import (
"github.com/imdevlab/g/utils"
"go.uber.org/zap"

"github.com/shaocongcong/tracing/collector/misc"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/pinpoint"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/trace"
"github.com/shaocongcong/tracing/pkg/proto/stats"
"github.com/imdevlab/tracing/collector/misc"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/pinpoint"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/trace"
"github.com/imdevlab/tracing/pkg/stats"
)

// 服务统计数据只实时计算1分钟的点,不做任何滑动窗口
@@ -7,7 +7,7 @@ import (
"github.com/imdevlab/g"
"go.uber.org/zap"

"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/trace"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/trace"
)

// Apps 所有app服务信息
@@ -8,10 +8,9 @@ import (
"go.uber.org/zap"

"github.com/imdevlab/g"
"github.com/imdevlab/tracing/util"
"github.com/shaocongcong/tracing/collector/misc"
"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/shaocongcong/tracing/pkg/proto/ttype"
"github.com/imdevlab/tracing/collector/misc"
"github.com/imdevlab/tracing/pkg/network"
"github.com/imdevlab/tracing/pkg/ttype"
"github.com/vmihailenco/msgpack"
)

@@ -120,7 +119,7 @@ func cmdPacket(conn net.Conn, packet *network.TracePack) error {
}
switch cmd.Type {
case ttype.TypeOfPing:
ping := util.NewPing()
ping := network.NewPing()
if err := msgpack.Unmarshal(cmd.Payload, ping); err != nil {
g.L.Warn("msgpack Unmarshal", zap.String("error", err.Error()))
return err
@@ -5,7 +5,7 @@ import (
"time"

"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/collector/misc"
"github.com/imdevlab/tracing/collector/misc"
"go.etcd.io/etcd/clientv3"

"go.uber.org/zap"
@@ -6,11 +6,11 @@ import (
"net"
"time"

"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/shaocongcong/tracing/pkg/proto/ttype"
"github.com/imdevlab/tracing/pkg/network"
"github.com/imdevlab/tracing/pkg/ttype"

"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/collector/misc"
"github.com/imdevlab/tracing/collector/misc"
"go.uber.org/zap"
)

@@ -6,12 +6,12 @@ import (
"net"

"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/pinpoint"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/trace"
"github.com/shaocongcong/tracing/pkg/proto/sql"
"github.com/shaocongcong/tracing/pkg/proto/ttype"
"github.com/imdevlab/tracing/pkg/network"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/pinpoint"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/trace"
"github.com/imdevlab/tracing/pkg/sql"
"github.com/imdevlab/tracing/pkg/ttype"
"github.com/vmihailenco/msgpack"
"go.uber.org/zap"
)
@@ -1,10 +1,10 @@
package service

import (
"github.com/shaocongcong/tracing/collector/misc"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/trace"
"github.com/shaocongcong/tracing/pkg/proto/stats"
"github.com/shaocongcong/tracing/pkg/proto/ttype"
"github.com/imdevlab/tracing/collector/misc"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/trace"
"github.com/imdevlab/tracing/pkg/stats"
"github.com/imdevlab/tracing/pkg/ttype"
)

// Stats 计算结果
@@ -6,12 +6,11 @@ import (

"github.com/gocql/gocql"
"github.com/imdevlab/g"
"github.com/imdevlab/tracing/util"
"github.com/shaocongcong/tracing/collector/misc"
"github.com/shaocongcong/tracing/pkg/proto/network"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/pinpoint"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/trace"
"github.com/shaocongcong/tracing/pkg/proto/sql"
"github.com/imdevlab/tracing/collector/misc"
"github.com/imdevlab/tracing/pkg/network"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/pinpoint"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/trace"
"github.com/imdevlab/tracing/pkg/sql"
"github.com/sunface/talent"
"go.uber.org/zap"
)
@@ -510,26 +509,26 @@ func (s *Storage) systemStore() {
}

// WriteMetric ...
func (s *Storage) WriteMetric(metrics []*util.MetricData) error {
// batchInsert := s.cql.NewBatch(gocql.UnloggedBatch)

// for _, metric := range metrics {
// b, err := json.Marshal(&metric.Payload)
// if err != nil {
// g.L.Warn("json", zap.String("error", err.Error()), zap.Any("data", metric.Payload))
// continue
// }
// batchInsert.Query(misc.InsertSystems,
// metric.AppName,
// metric.AgentID,
// metric.Time,
// b)

// }

// if err := s.cql.ExecuteBatch(batchInsert); err != nil {
// g.L.Warn("insert metric", zap.String("error", err.Error()), zap.String("SQL", misc.InsertSystems))
// return err
// }
return nil
}
// func (s *Storage) WriteMetric(metrics []*util.MetricData) error {
// batchInsert := s.cql.NewBatch(gocql.UnloggedBatch)

// for _, metric := range metrics {
// b, err := json.Marshal(&metric.Payload)
// if err != nil {
// g.L.Warn("json", zap.String("error", err.Error()), zap.Any("data", metric.Payload))
// continue
// }
// batchInsert.Query(misc.InsertSystems,
// metric.AppName,
// metric.AgentID,
// metric.Time,
// b)

// }

// if err := s.cql.ExecuteBatch(batchInsert); err != nil {
// g.L.Warn("insert metric", zap.String("error", err.Error()), zap.String("SQL", misc.InsertSystems))
// return err
// }
// return nil
// }
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -6,7 +6,7 @@ import (

"github.com/golang/snappy"
"github.com/imdevlab/g"
"github.com/shaocongcong/tracing/pkg/proto/ttype"
"github.com/imdevlab/tracing/pkg/ttype"
"go.uber.org/zap"
)

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -4,7 +4,7 @@ import (
"io"
"net"

"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/trace"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/trace"
)

const TCP_MAX_PACKET_SIZE int = 16 * 1024
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -2,9 +2,9 @@ package thrift

import (
"git.apache.org/thrift.git/lib/go/thrift"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/command"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/pinpoint"
"github.com/shaocongcong/tracing/pkg/proto/pinpoint/thrift/trace"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/command"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/pinpoint"
"github.com/imdevlab/tracing/pkg/pinpoint/thrift/trace"
)

type Header struct {

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit 2371356

Please sign in to comment.
You can’t perform that action at this time.