summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/golang/protobuf/descriptor/descriptor_test.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-11-22 11:05:54 -0800
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-22 14:05:54 -0500
commit7961599b2e41c71720a42b3bfde641f7529f05fe (patch)
tree3c039e1d3790a954ba65fe551c7b348331bce994 /vendor/github.com/golang/protobuf/descriptor/descriptor_test.go
parente033dcce8e57ed6b6684227adf9b29347e4718b3 (diff)
downloadchat-7961599b2e41c71720a42b3bfde641f7529f05fe.tar.gz
chat-7961599b2e41c71720a42b3bfde641f7529f05fe.tar.bz2
chat-7961599b2e41c71720a42b3bfde641f7529f05fe.zip
PLT-4357 adding performance monitoring (#4622)
* WIP * WIP * Adding metrics collection * updating vendor packages * Adding metrics to config * Adding admin console page for perf monitoring * Updating glide * switching to tylerb/graceful
Diffstat (limited to 'vendor/github.com/golang/protobuf/descriptor/descriptor_test.go')
-rw-r--r--vendor/github.com/golang/protobuf/descriptor/descriptor_test.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/github.com/golang/protobuf/descriptor/descriptor_test.go b/vendor/github.com/golang/protobuf/descriptor/descriptor_test.go
new file mode 100644
index 000000000..282a1e3a7
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/descriptor/descriptor_test.go
@@ -0,0 +1,32 @@
+package descriptor_test
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/golang/protobuf/descriptor"
+ tpb "github.com/golang/protobuf/proto/testdata"
+ protobuf "google.golang.org/genproto/protobuf"
+)
+
+func TestMessage(t *testing.T) {
+ var msg *protobuf.DescriptorProto
+ fd, md := descriptor.ForMessage(msg)
+ if pkg, want := fd.GetPackage(), "google.protobuf"; pkg != want {
+ t.Errorf("descriptor.ForMessage(%T).GetPackage() = %q; want %q", msg, pkg, want)
+ }
+ if name, want := md.GetName(), "DescriptorProto"; name != want {
+ t.Fatalf("descriptor.ForMessage(%T).GetName() = %q; want %q", msg, name, want)
+ }
+}
+
+func Example_Options() {
+ var msg *tpb.MyMessageSet
+ _, md := descriptor.ForMessage(msg)
+ if md.GetOptions().GetMessageSetWireFormat() {
+ fmt.Printf("%v uses option message_set_wire_format.\n", md.GetName())
+ }
+
+ // Output:
+ // MyMessageSet uses option message_set_wire_format.
+}