Skip to content

Commit

Permalink
change to Exp (alpha cant be reused for 7 days)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Russell committed Nov 19, 2021
1 parent a06b4d0 commit 32d2b5e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion parser/pcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (p *PCAPParser) ParseAndInsert(fileMetadata map[string]bigquery.Value, test
GitCommit: GitCommit(),
},

Alpha: alpha,
Exp: alpha,
}

if err := p.Put(&row); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion parser/pcap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestPCAPParser_ParseAndInsert(t *testing.T) {
Parser: expectedParseInfo,
Date: date,

Alpha: &schema.AlphaFields{
Exp: &schema.AlphaFields{
SynPacket: 0,
SynTime: time.Date(2021, 07, 21, 00, 00, 01, 181050000, time.UTC),
SynAckPacket: 1,
Expand Down
22 changes: 11 additions & 11 deletions schema/pcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ type TcpStats struct {
}

type AlphaFields struct {
TruncatedPackets int64 `bigquery:"truncated_packets"`
SynPacket int64 `bigquery:"syn_packet" json:"syn_packet"`
SynTime time.Time `bigquery:"syn_time" json:"syn_time"`
SynAckPacket int64 `bigquery:"syn_ack_packet" json:"syn_ack_packet"`
SynAckTime time.Time `bigquery:"syn_ack_time" json:"syn_ack_time"`
Packets int64 `bigquery:"packets" json:"packets"`
Sacks int64 `bigquery:"sacks" json:"sacks"`
IPAddrErrors int64 `bigquery:"ip_addr_errors" json:"ip_addr_errors"` // Number of packets with IP addresses that don't match first IP header at all.
WithoutTCPLayer int64 `bigquery:"no_tcp_layer" json:"no_tcp_layer"` // Number of packets with no TCP layer.
TruncatedPackets int64
SynPacket int64
SynTime time.Time
SynAckPacket int64
SynAckTime time.Time
Packets int64
Sacks int64
IPAddrErrors int64 // Number of packets with IP addresses that don't match first IP header at all.
WithoutTCPLayer int64 // Number of packets with no TCP layer.

LeftStats TcpStats
RightStats TcpStats
Expand All @@ -59,10 +59,10 @@ type PCAPRow struct {
Parser ParseInfo `bigquery:"parser" json:"parser"`
Date civil.Date `bigquery:"date" json:"date"`

Alpha *AlphaFields `bigquery:"alpha" json:"alpha"`
Exp *AlphaFields `bigquery:"exp_a" json:"alpha"`

// NOT part of struct schema. Included only to provide a fake annotator interface.
row.NullAnnotator `bigquery:"-"`
row.NullAnnotator `bigquery:"-" json:"-"`
}

// Schema returns the Bigquery schema for Pcap.
Expand Down

0 comments on commit 32d2b5e

Please sign in to comment.