// GetIOTicks returns the duration the disk has been active.
429212
func (ds *DiskStat) GetIOTicks() time.Duration {
	return time.Duration(ds.IOTicks) * time.Millisecond
}
897405
func (p IDInfo) GetCounts() (Counts, int, error) {
	return p.Metrics.Counts, 0, nil
}
104743
func (r Row) GetDuration(colIdx int, fillFsp int) types.Duration {
	col := r.c.columns[colIdx]
	dur := *(*int64)(unsafe.Pointer(&col.data[r.idx*8]))
	return types.Duration{Duration: time.Duration(dur), Fsp: fillFsp}
}
1077224
func (self *DefaultRequest) GetRedirectTimes() int {
	self.once.Do(self.prepare)
	return self.RedirectTimes
}
144490
func GetStats() (stats Stats, err error) {
	var limit uint64
	limit, err = getMemoryLimit()
	if err != nil {
		return Stats{}, err
	}

	stats.TotalRAM = limit
	return stats, nil
}
865794
func GetStats() (stats Stats, err error) {
	stats.TotalRAM, err = getHwPhysmem()
	return stats, err
}
1126180
func (c *sioClient) getSioDiskPaths() ([]os.FileInfo, error) {
	files, err := ioutil.ReadDir(sioDiskIDPath)
	if err != nil {
		if os.IsNotExist(err) {
			// sioDiskIDPath may not exist yet which is fine
			return []os.FileInfo{}, nil
		}
		klog.Error(log("failed to ReadDir %s: %v", sioDiskIDPath, err))
		return nil, err

	}
	result := []os.FileInfo{}
	for _, file := range files {
		if c.diskRegex.MatchString(file.Name()) {
			result = append(result, file)
		}
	}

	return result, nil

}
692997
func (t *Template) GetAllAWSIoTThingResources() map[string]*resources.AWSIoTThing {
	results := map[string]*resources.AWSIoTThing{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSIoTThing:
			results[name] = resource
		}
	}
	return results
}
1038212
func getRecordsThrottle(d time.Duration) <-chan time.Time {
	if d == 0 {
		d = DefaultGetRecordsThrottle
	}

	return time.NewTicker(d).C
}
325604
func (p *Plugin) GetInterfaceStats() status.InterfaceStats {
	p.access.Lock()
	defer p.access.Unlock()

	return *p.interfaceStat
}
390741
func (d dynamicSystemView) fetchTTLs() (def, max time.Duration) {
	def = d.core.defaultLeaseTTL
	max = d.core.maxLeaseTTL

	if d.mountEntry != nil {
		if d.mountEntry.Config.DefaultLeaseTTL != 0 {
			def = d.mountEntry.Config.DefaultLeaseTTL
		}
		if d.mountEntry.Config.MaxLeaseTTL != 0 {
			max = d.mountEntry.Config.MaxLeaseTTL
		}
	}

	return
}
494152
func (s *Duration) Get() time.Duration {
	return time.Duration(atomic.LoadInt64(&s.currentVal))
}
1001999
func (cs *Stats) GetStatistics() StatsEntry {
	cs.mutex.Lock()
	defer cs.mutex.Unlock()
	return cs.StatsEntry
}
1236481
func (d *Device) FetchAttributes(timeout time.Duration) (*DeviceAttributes, error) {
	if d.Scan.SearchType != DTMaker {
		return nil, ErrUnsupportedAction
	}

	location := parseLocation(d.Scan.Location)
	body, err := sendSOAP(
		timeout,
		location,
		"urn:Belkin:service:deviceevent:1",
		"/upnp/control/deviceevent1",
		"GetAttributes",
		"",
	)

	if err != nil {
		return nil, err
	}

	// Response is double encoded
	body = html.UnescapeString(html.UnescapeString(body))

	/* Response looks like:
		<s:Envelope
	    	xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
		    s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
			<s:Body>
			    <u:GetAttributesResponse xmlns:u="urn:Belkin:service:deviceevent:1">
	    		<attributeList>
	    			<attribute>
					    <name>Switch</name>
						<value>1</value>
					</attribute>
					<attribute>
					    <name>Sensor</name>
	    				<value>1</value>
					</attribute>
					<attribute>
		    			<name>SwitchMode</name>
			    		<value>0</value>
					</attribute>
					<attribute>
				    	<name>SensorPresent</name>
					    <value>1</value>
					</attribute>
					</attributeList>
	    		</u:GetAttributesResponse>
			</s:Body>
		</s:Envelope>*/

	r := regexp.MustCompile(`(?s)(<attributeList>.*</attributeList>)`)
	attrList := r.FindStringSubmatch(body)
	if attrList == nil || len(attrList) == 0 {
		return nil, errors.New("attributeList element not found in response from device")
	}

	attrs := ParseAttributeList(attrList[0])
	return attrs, nil
}
10048
func getSystemTimes(idleTime, kernelTime, userTime *FileTime) bool {
	ret, _, _ := procGetSystemTimes.Call(
		uintptr(unsafe.Pointer(idleTime)),
		uintptr(unsafe.Pointer(kernelTime)),
		uintptr(unsafe.Pointer(userTime)))

	return ret != 0
}
1284873
func GetBootTime() (time.Time, error) {
	currentTime := time.Now()
	var info unix.Sysinfo_t
	if err := unix.Sysinfo(&info); err != nil {
		return time.Time{}, fmt.Errorf("error getting system uptime: %s", err)
	}
	return currentTime.Add(-time.Duration(info.Uptime) * time.Second).Truncate(time.Second), nil
}
692127
func (hc *HealthCheck) GetTimeout() time.Duration {
	timeout := hc.Timeout
	if timeout <= 0 {
		timeout = DefaultTimeout
	}
	return timeout
}